Differences between version 6 and predecessor to the previous major change of AdHoc.
Other diffs: Previous Revision, Previous Author, or view the Annotated Edit History
Newer page: | version 6 | Last edited on Tuesday, September 21, 2004 5:01:40 pm | by DanielLawson | Revert |
Older page: | version 5 | Last edited on Tuesday, September 21, 2004 4:53:31 pm | by BillRosoman | Revert |
@@ -1,10 +1,12 @@
Wireless Ad-Hoc connection
-==========================
+----
These commands were useful
-----------------------
----
+----
http://iptables-tutorial.frozentux.net/iptables-tutorial.html
+
+<verbatim>
nmap -v mordor
Starting nmap 3.50 ( http://www.insecure.org/nmap/ ) at 2004-09-21 16:03 EDT
Host mordor.localdomain (192.168.1.1) appears to be up ... good.
Initiating SYN Stealth Scan against mordor.localdomain (192.168.1.1) at 16:03
@@ -19,41 +21,60 @@
139/tcp open netbios-ssn
5000/tcp open UPnP
Nmap run completed -- 1 IP address (1 host up) scanned in 72.847 seconds
+
+</verbatim>
tcpdump -i eth1
cat /etc/rc.d/init.d/iptables
+
cat /proc/sys/net/ipv4/ip_forward
+
echo 1 > /proc/sys/net/ipv4/ip_forward
+
/sbin/iptables -t nat -A PREROUTING -s 192.168.1.0/255.255.255.0 -d 10.0.4./16 -i eth1 -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 3128
+
iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE
kedit /etc/dhcpd.conf.sample
+
kedit /etc/dhcpd.conf
+
dhcpcd -i eth1 &
+
dhcpcd eth1
+
watch -n 1 iwconfig eth1
+
ping -c 4 localhost
+
netstat
+
netstat -r
+
traceroute mordor
+
+<verbatim>
nslookup
> mordor
Server: 192.168.1.1
Address: 192.168.1.1#53
Non-authoritative answer:
Name: mordor.mshome.net
Address: 192.168.0.3
+</verbatim>
+<verbatim>
ping -c 4 192.168.1.1
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=6.48 ms
64 bytes from 192.168.1.1: icmp_seq=2 ttl=64 time=3.19 ms
64 bytes from 192.168.1.1: icmp_seq=3 ttl=64 time=3.23 ms
64 bytes from 192.168.1.1: icmp_seq=4 ttl=64 time=3.75 ms
+</verbatim>
Edit Config files
=================
kedit /etc/sysconfig/network
@@ -105,16 +126,18 @@
iwlist eth1 scanning
samba status
hostname
+<verbatim>
route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.0.0.3 0.0.0.0 255.255.255.255 UH 1 0 0 sl0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 eth1
0.0.0.0 0.0.0.0 0.0.0.0 U 1 0 0 sl0
+</verbatim>
Windows Wifi is Zyair B220 looks like only 802b
LAN is 192.168.0.1
Wlan is 192.168.1.1
@@ -139,37 +162,46 @@
ping 192.168.1.1 excellent
Linux machine
apradar result
+<verbatim>
eth1 Scan completed :
NEW AP from accesspoint scan
essid.length 4 ESSID:"deb1"
Mode:Ad-Hoc 1
Encryption key:off
Frequency:2.437GHz
quality: -56
+</verbatim>
+<verbatim>
ping 192.168.0.1
PING 192.168.0.1 (192.168.0.1) 56(84) bytes of data.
[1]+ Stopped ping 192.168.0.1
+</verbatim>
Hangs!
+<verbatim>
iwlist eth1 scanning
eth1 Scan completed :
Cell 01 - Address: 42:F5:A8:9E:54:CF
ESSID:"deb1"
Mode:Ad-Hoc
Encryption key:off
Frequency:2.437GHz
Quality:190/0 Signal level:-55 dBm Noise level:-245 dBm
+</verbatim>
+<verbatim>
iwspy eth1
eth1 Statistics collected:
00:00:00:00:28:C2 : Quality:0 Signal level:0 Noise level:0
Link/Cell/AP : Quality:188/0 Signal level:-53 dBm Noise level:-5 dBm (updated)
Typical/Reference : Quality:0/0 Signal level:-80 dBm Noise level:-256 dBm
+</verbatim>
+<verbatim>
iwconfig
lo no wireless extensions.
eth0 no wireless extensions.
@@ -188,19 +220,23 @@
Bit Rate=-1.07375e+06kb/s Tx-Power=-1073746380 dBm Sensitivity=8/0
Retry:on RTS thr=-1073746380 B Fragment thr=-1073746380 B
Encryption key:0000-0000-0000-0000-0000-0000-0000-0000-0000-0000-0000-0000-0000-0000-0000-0000
Power Management:on
+</verbatim>
NB sl0 is my Modem
+<verbatim>
cat /proc/net/dev
Inter-| Receive | Transmit
face |bytes packets errs drop fifo frame compressed multicast|bytes packets errs drop fifo colls carrier compressed
lo: 36700 511 0 0 0 0 0 0 36700 511 0 0 0 0 0 0
eth0: 0 0 0 0 0 0 0 0 5476 18 0 0 0 0 18 0
eth1: 985616 12647 0 0 0 0 0 0 111013 868 0 0 0 0 0 0
sl0: 0 0 0 0 0 0 0 0 68564 819 0 0 0 0 0 0
sit0: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+</verbatim>
+<verbatim>
iwconfig eth1
eth1 IEEE 802.11b/g ESSID:"deb1" Nickname:"mordor"
Mode:Ad-Hoc Channel:6 Cell: 9E:05:A8:9E:54:CF
Bit Rate:11Mb/s Tx-Power=31 dBm Sensitivity=20/200
@@ -208,17 +244,21 @@
Encryption key:off
Link Quality:196/0 Signal level:-55 dBm Noise level:-245 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0
+</verbatim>
+<verbatim>
route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.0.0.3 0.0.0.0 255.255.255.255 UH 1 0 0 sl0
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 0.0.0.0 0.0.0.0 U 1 0 0 sl0
+</verbatim>
+<verbatim>
ifconfig eth1
eth1 Link encap:Ethernet HWaddr 00:09:5B:C2:C7:1A
inet addr:192.168.0.5 Bcast:192.168.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
@@ -226,16 +266,18 @@
TX packets:48 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:5316 (5.1 Kb)
Interrupt:10
+</verbatim>
If I remove WLAN and insert LAN I get
+<verbatim>
ping 192.168.0.1
PING 192.168.0.1 (192.168.0.1) 56(84) bytes of data.
64 bytes from 192.168.0.1: icmp_seq=1 ttl=64 time=0.549 ms
64 bytes from 192.168.0.1: icmp_seq=2 ttl=64 time=0.328 ms
64 bytes from 192.168.0.1: icmp_seq=3 ttl=64 time=0.322 ms
-
+</verbatim>
NOTE: It's important that you setup the interface in the following steps
1) Make sure the interface (eth1) is down
2) Execute the iwconfig commands