[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Share internet connection with Ad-hoc mode.



Hi all.

I have two notebook and i want to share internet connection from old notebook(Debian 4.0 etch) to new notebook(ubuntu 8.04).Old notebook will work ad-hoc mode and other notebooks will connect to internet from debian notebook.

I configured debian notebook like below:

LAN (eth0) : IP: 192.168.1.3 GW:192.168.1.254 DNS:192.168.1.254 and share internet connection with iptables.
Wireless(eth1) : IP:192.168.0.1 GW: dont use , DNS: dont use , Authentication: WEP-128bit HEX , Mode: Ad-hoc , ESSID: debian

Enable ipv4_forward and write iptables configuration like below:

# iptables -A FORWARD -i eth1 -o eth0 -j ACCEPT
# iptables -A FORWARD -i eth0 -o eth1 -m state --state ESTABLISHED,RELATED -j ACCEPT
# iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

and wireless information like below:

--------------------------------------------
#debian:~# iwconfig

lo        no wireless extensions.

eth0      no wireless extensions.

eth1   IEEE 802.11b  ESSID:"debian"  Nickname:"ipw2100"
         Mode:Ad-Hoc  Frequency:2.412 GHz  Cell: 02:0C:F1:42:EF:EF  
         Bit Rate=0 kb/s   Tx-Power:16 dBm   
         Retry min limit:7   RTS thr:off   Fragment thr:off
         Encryption key:PASSWORD is HERE(like xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xx) Security mode:open
         Power Management:off
         Link Quality=60/100  Signal level=-83 dBm 
         Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
         Tx excessive retries:0  Invalid misc:0   Missed beacon:0
------------------------------------------------------------------

and ps auxc command like below:

---------------------------------------

root      3635  0.0  0.2   2656  1124 ?        Ss   18:54   0:00 dhcpd3

-------------------------------------------

dhcpd3 is running.

and it works ! but not on ubuntu 8.04 !

it only works vi_sta machine.Vi_sta can connect to internet with wireless and take an ip from debian notebook dhcp server.

Ubuntu8.04 can not connect to internet and can not take an ip from debian dhcp server.

Ubuntu 8.04's route command like below:

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
localnet        *               255.255.255.0   U     0      0        0 wlan0
link-local      *               255.255.0.0     U     1000   0        0 wlan0
default         192.168.0.1   0.0.0.0         UG    100    0        0 wlan0


ubuntu can find debian wireless , I enter WEP-128 HEX password and it connect to debian essid but DO NOT take an ip from debian dhcp server.

iwconfig command on ubuntu like below:

-------------------------------------
lo        no wireless extensions.

eth0      no wireless extensions.

wlan0     IEEE 802.11g  ESSID:"debian" 
          Mode:Ad-Hoc  Frequency:2.412 GHz  Cell: 02:0C:F1:42:EF:EF  
          Bit Rate=54 Mb/s  
          Power Management:off
          Link Quality:62/100  Signal level:-56 dBm  Noise level:-96 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:4  Invalid misc:1544   Missed beacon:0

---------------------------------------------------------------------------


ifconfig command on ubuntu like below:

--------------------------------------------------------------

lo        Link encap:Local Loopback 
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:103 errors:0 dropped:0 overruns:0 frame:0
          TX packets:103 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:8796 (8.5 KB)  TX bytes:8796 (8.5 KB)

wlan0     Link encap:Ethernet  HWaddr 00:15:af:4f:46:9d 
          inet6 addr: fe80::215:afff:fe4f:469d/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:9 errors:0 dropped:0 overruns:0 frame:0
          TX packets:81 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:378 (378.0 B)  TX bytes:14357 (14.0 KB)
          Interrupt:19 Memory:f0300000-f0310000

wlan0:avahi Link encap:Ethernet  HWaddr 00:15:af:4f:46:9d 
          inet addr:169.254.6.138  Bcast:169.254.255.255  Mask:255.255.0.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          Interrupt:19 Memory:f0300000-f0310000

-------------------------------------------------------------------------------------------

And i tried dhclient command on ubuntu like below:

# dhclient wlan0

Listening on LPF/wlan0/00:15:af:4f:46:9d
Sending on   LPF/wlan0/00:15:af:4f:46:9d
Sending on   Socket/fallback
DHCPREQUEST of 192.168.0.187 on wlan0 to 255.255.255.255 port 67
DHCPREQUEST of 192.168.0.187 on wlan0 to 255.255.255.255 port 67
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 8
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 10
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 11
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 16
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 16
No DHCPOFFERS received.
Trying recorded lease 192.168.0.187
PING 192.168.0.1 (192.168.0.1) 56(84) bytes of data.

--- 192.168.0.1 ping statistics ---
1 packets transmitted, 0 received, +1 errors, 100% packet loss, time 0ms

No working leases in persistent database - sleeping.

--------------------------------------------------------------------------------


it took ip from apipa like 169.254.....

and i tried manual ip configuration but not worked.I can not ping to 192.168.0.1

Why can not I connnection to internet with ubuntu8.04 machine ?

If you help me,i will be happy. Thanks all.



--
Iyi calismalar.Basarilar...
Semih Gokalp
Turkiye

Reply to: