Jump to content

Why Does Plugging In The Fon Stop The Internet Working?


Recommended Posts

Here is what I am trying to achieve:

Client --> Fon --> Ethernet cable --> Laptop --> Wireless internet connection.

Here is what happens (and what goes wrong):

The Laptop connects to the Wireless internet connection. The IP is 192.168.1.50. The DNS and gateway is 192.168.1.254. The subnet is 255.255.255.0.

I then connect the Fon to the Laptop. The Fon's IP is 192.168.1.5 (same subnet). The DNS and gateway shows 192.168.1.254. The subnet is 255.255.255.0. These details are based on my editing of /etc/config/dhcp and /etc/config/network.

I can connect the Client to the Fon's network. The client has the IP 192.168.1.20 (same subnet). It also claims that 192.168.1.5 is its DHCP server.

The problem:

The Laptop's internet connection stops working the second a connection is made between the Fon and the Laptop via ethernet cable. Disconnecting the ethernet cable allows the Laptop's internet to start working again.

What am I doing wrong?

Thanks.

Link to comment
Share on other sites

I'm guessing your laptop has a default gateway on the ethernet interface. If so, it shouldn't.

I'm sorry but I don't understand what you mean.

Here is the situation:

Fon --> Ethernet cable --> Laptop --> Wireless internet connection.

The ethernet cable connects to the laptop on eth0. The IP is 192.168.1.234.

The laptop connects to the wireless internet connection on wlan0. The IP is 192.168.1.93.

The Fon's IP is 192.168.1.5. This is the IP I use to ssh into.

Forwarding is setup using (as root):

echo "1" > /proc/sys/net/ipv4/ip_forward

sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

All ideas gratefully received.

Link to comment
Share on other sites

what i think that happens is that the laptop see's both the subnets on both interfaces. most of the time the kabel connection has a lower metric then the wifi one.

if you type route print in a cmd prompt you can see what your laptop thinks.

either give your fon a other subnet or what maybe helps is bridge the wifi and eth connection on your laptop (not sure if that helps).

Link to comment
Share on other sites

what i think that happens is that the laptop see's both the subnets on both interfaces. most of the time the kabel connection has a lower metric then the wifi one.

if you type route print in a cmd prompt you can see what your laptop thinks.

either give your fon a other subnet or what maybe helps is bridge the wifi and eth connection on your laptop (not sure if that helps).

Thanks for this suggestions and also thanks to Mr. Protocol. I have made some progression.

The Fon (eth0) now provides an IP of 192.168.2.234. Its default gateway is 192.168.2.254.

route -n shows:

0.0.0.0 192.168.2.254 0.0.0.0 UG 0 0 0 eth0

The connection between my laptop and the wireless network provides me with an IP of 192.168.1.95 with a default gateway of 192.168.1.254. Obviously the Fon is now on a different subnet.

When I enter a URL e.g. www.yahoo.com, Wireshark on wlan0 shows that 192.168.1.95 does a DNS request on 192.168.1.254 which returns the Yahoo IP. However, after a few seconds the website refuses to load. Using the IP of Yahoo does not change anything (which, AIUI, suggests that the wireless network's DNS is not the problem). All websites refuse to load.

I am getting closer but clearly something is wrong. Any more suggestions? Thanks.

Link to comment
Share on other sites

the gateway of the fon should be the ip of your eth0 on the laptop

I am afraid that changing the eth0 gateway IP to the eth0 IP (as provided by the Fon's DHCP) does not change anything.

I type in www.yahoo.com. Wireshark on wlan0 shows a request from my IP (192.168.1.96) to the DNS on wlan0 (192.168.1.254) then the DNS replies to 192.168.1.96 and that's it - no more traffic.

Perhaps I have somehow misconfigured the relevant files:

Here is my /etc/config/network file:

config interface loopback

option ifname lo

option proto static

option ipaddr 127.0.0.1

option netmask 255.0.0.0

config interface lan

option ifname eth0

option type bridge

option proto static

option ipaddr 192.168.2.2 # Fon IP.

option netmask 255.255.255.0

Here is my /etc/config/dhcp file:

onfig dnsmasq

option domainneeded 1

option boguspriv 1

option filterwin2k '0' #enable for dial on demand

option localise_queries 1

option local '/lan/'

option domain 'lan'

option expandhosts 1

option nonegcache 0

option authoritative 1

option readethers 1

option leasefile '/tmp/dhcp.leases'

option resolvfile '/tmp/resolv.conf.auto'

config dhcp lan

option interface lan

option start 100

option limit 150

option leasetime 12h

list 'dhcp_option' '3,192.168.2.234' # Gateway IP - this is the same IP as the Fon gives to me.

list 'dhcp_option' '6,192.168.1.254' # DNS - same as wlan0 DNS but I have also tried Google's DNS. Anyhow it appears that wlan0 queries its own DNS not that of the Fon.

config dhcp wan

option interface wan

option ignore 1

Any more ideas - thanks!

Link to comment
Share on other sites

What is listening on 192.168.2.234?

list 'dhcp_option' '3,192.168.2.234' # Gateway IP - this is the same IP as the Fon gives to me.

If this is the gateway then it should be the IP address of the wifi interface (ath0 or wifi0) on the Fon.

Link to comment
Share on other sites

What is listening on 192.168.2.234?

If this is the gateway then it should be the IP address of the wifi interface (ath0 or wifi0) on the Fon.

My impression is that I tried this previously and it didn't work but let me provide more detail.

Before I begin let me stress that I have eth0 (not ath0) and wlan0 (not wifi0) - does that matter? Eth0 is the connection between the Fon and the Laptop and wifi0 is the connection between the Laptop and my wireless network.

I also want to note that all I am trying to do at this stage is have a laptop connected to a wireless network then plug in the Fon and make sure that I can continue to get internet. I am not yet connecting another client to the Fon.

So the connection is: Fon ---> Ethernet Cable ---> Laptop ---> Wireless network.

The problem appears to be that plugging in the Fon changes the default gateway. Previously the default gateway is (for example) 192.168.1.1 on wlan0. The Fon changes it to a certain IP on eth0. So your question is: what is listening on this IP on eth0?

The spacing below screws up but it shows the IPs for wlan0 and eth0.

Wlan0 Eth0

IP - 192.168.1.95 192.168.2.234 (different subnet to wlan0 IP)

Broadcast 192.168.1.255 192.168.2.255

Subnet 255.255.255.0 255.255.255.0

Default gateway 192.168.1.254 192.168.1.95 (wlan0 IP) or 192.168.2.234 (eth0 IP)

DNS 192.168.1.254 192.168.1.254

It does not seem to matter whether the Fon's default gateway is the IP of wlan0 or the IP of eth0 - the following happens as recorded by Wireshark.

There are three stages:

First: wlan0

192.168.1.95 (wlan0 IP) --> 192.168.1.254 (wlan0 DNS) DNS standard query A for website.com

192.168.1.254 (wlan0 DNS) --> 192.168.1.95 (wlan0 IP) DNS standard response CNAME for website.com

Second: eth0

eth0 MAC ---> broadcast ARP who has IP of website.com - please tell 192.168.2.243 (eth0 IP).

Third: eth0

192.168.2.243 (eth0 IP) ---> 192.168.2.243 (eth0 IP) - ICMP destination unreachable

What am I doing wrong? There is obviously some connectivity hence the DNS request on wlan0. All help gratefully appreciated.

Edited by billyblaxsta
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...