Networking Forums

Networking Forums > Computer Networking > Linux Networking > 2 interfaces, 2 gateways, no internet

Reply
Thread Tools Display Modes

2 interfaces, 2 gateways, no internet

 
 
Simon GUEROUT
Guest
Posts: n/a

 
      02-11-2009, 03:26 PM
Hello,

I am trying to have a nice embedded board working, but I can't manage
to have internet under special circumstances.

Let me explain:
* The board has 2 interfaces : wireless and ethernet
* Both are working perfectly well when used separately
* When I have both interfaces on, no internet, can't even ping the
DNS...

The wireless network is 192.168.1.0, gw 192.168.1.1
The ethernet network is 192.168.2.0, gw 192.168.2.1

Routes look like:
Destination Gateway Genmask Flags Metric Ref
Use Iface
192.168.3.0 * 255.255.255.0 U 0 0
0 tiwlan0
192.168.2.0 * 255.255.255.0 U 0 0
0 eth0
default 192.168.3.1 0.0.0.0 UG 0 0
0 tiwlan0
default 192.168.2.1 0.0.0.0 UG 0 0
0 eth0

My problem disappears if I remove one of the default route.

=> Is it possible to have internet access on both interfaces at the
same time ?
=> Is there a solution that would not require using complicated and
specific stuff (ie. something I could trigger automatically when both
interfaces are up using a simple script/program) ?

I do not have a lot of tools on this board (no NetworkManager).
BTW, my kernel is a 2.6.10 version, from Montavista on an TI DaVinci
processor.

Thanks!
 
Reply With Quote
 
 
 
 
Tauno Voipio
Guest
Posts: n/a

 
      02-11-2009, 06:17 PM
Simon GUEROUT wrote:
> Hello,
>
> I am trying to have a nice embedded board working, but I can't manage
> to have internet under special circumstances.
>
> Let me explain:
> * The board has 2 interfaces : wireless and ethernet
> * Both are working perfectly well when used separately
> * When I have both interfaces on, no internet, can't even ping the
> DNS...
>
> The wireless network is 192.168.1.0, gw 192.168.1.1
> The ethernet network is 192.168.2.0, gw 192.168.2.1
>
> Routes look like:
> Destination Gateway Genmask Flags Metric Ref
> Use Iface
> 192.168.3.0 * 255.255.255.0 U 0 0
> 0 tiwlan0
> 192.168.2.0 * 255.255.255.0 U 0 0
> 0 eth0
> default 192.168.3.1 0.0.0.0 UG 0 0
> 0 tiwlan0
> default 192.168.2.1 0.0.0.0 UG 0 0
> 0 eth0
>
> My problem disappears if I remove one of the default route.
>
> => Is it possible to have internet access on both interfaces at the
> same time ?
> => Is there a solution that would not require using complicated and
> specific stuff (ie. something I could trigger automatically when both
> interfaces are up using a simple script/program) ?
>
> I do not have a lot of tools on this board (no NetworkManager).
> BTW, my kernel is a 2.6.10 version, from Montavista on an TI DaVinci
> processor.
>
> Thanks!



For any leaf node in the Net, there is only one
default gateway: For any node, the default gateway
is the next node toward the rest of the Net.

Which interface do you want to use for the next
hop toward the Internet?

By the way: What is the 192.168.3.x network?

--

Tauno Voipio
tauno voipio (at) iki fi
 
Reply With Quote
 
David Schwartz
Guest
Posts: n/a

 
      02-11-2009, 08:49 PM
On Feb 11, 8:26*am, Simon GUEROUT <SaiiM...@gmail.com> wrote:

> My problem disappears if I remove one of the default route.


> => Is it possible to have internet access on both interfaces at the
> same time ?


Yes, but you have to comply with the requirements for NAT if you're
going to use NAT. Does this machine have a publicly-routable IP
address assigned to it or are you relying on the gateway(s) to do NAT?
The requirements are:

1) If this machine has a publicly-routable IP address, and you don't
want to use NAT, you must make sure that this address is the source
address for all packets sent by this machine. You must ensure that
both gateways will *not* try to NAT packets to or from this address.
Both gateways must be connected to Internet providers who will accept
packets *from* this address. You must also make sure the rest of the
world gets packets *to* this address to one of those gateways. Both
gateways must know to route packets to this address over the LAN to
the machine.

2) If this machine does not have a publicly-routable IP address, and
you want to have more than one gateway to NAT it, the NAT devices must
coordinate mappings. Otherwise, a packet that goes to the "wrong" NAT
device will find there is no mapping there, and the same logical
connection may wind up with a different NAT mapping on each gateway.

DS
 
Reply With Quote
 
Unruh
Guest
Posts: n/a

 
      02-11-2009, 09:58 PM
Simon GUEROUT <(E-Mail Removed)> writes:

>Hello,


>I am trying to have a nice embedded board working, but I can't manage
>to have internet under special circumstances.


>Let me explain:
>* The board has 2 interfaces : wireless and ethernet
>* Both are working perfectly well when used separately
>* When I have both interfaces on, no internet, can't even ping the
>DNS...


>The wireless network is 192.168.1.0, gw 192.168.1.1
>The ethernet network is 192.168.2.0, gw 192.168.2.1


There can be only one default gateway. Trying to have two of them makes no
sense.
The routing below says that the interface is 192.168.2.0 and 192.168.3.0
not 192.168.1.0 192.168.2.0


>Routes look like:
>Destination Gateway Genmask Flags Metric Ref
>Use Iface
>192.168.3.0 * 255.255.255.0 U 0 0
>0 tiwlan0
>192.168.2.0 * 255.255.255.0 U 0 0
>0 eth0
>default 192.168.3.1 0.0.0.0 UG 0 0
>0 tiwlan0
>default 192.168.2.1 0.0.0.0 UG 0 0
>0 eth0


>My problem disappears if I remove one of the default route.


Well do so.


>=> Is it possible to have internet access on both interfaces at the
>same time ?


Sure, but not two default routes. It makes no sense. "If the packet has no
known route send it via this one." makes sense for only ONE.

>=> Is there a solution that would not require using complicated and
>specific stuff (ie. something I could trigger automatically when both
>interfaces are up using a simple script/program) ?


And you want both up why?



>I do not have a lot of tools on this board (no NetworkManager).
>BTW, my kernel is a 2.6.10 version, from Montavista on an TI DaVinci
>processor.


>Thanks!

 
Reply With Quote
 
David Schwartz
Guest
Posts: n/a

 
      02-11-2009, 11:48 PM
On Feb 11, 2:58*pm, Unruh <unruh-s...@physics.ubc.ca> wrote:

> There can be only one default gateway. Trying to have two of them makes no
> sense.


Nonsense. There can be more than one default gateway, and having two
of them makes perfect sense. For example, one may be a backup in case
the other interface loses link.

DS
 
Reply With Quote
 
Unruh
Guest
Posts: n/a

 
      02-12-2009, 12:10 AM
David Schwartz <(E-Mail Removed)> writes:

>On Feb 11, 2:58=A0pm, Unruh <unruh-s...@physics.ubc.ca> wrote:


>> There can be only one default gateway. Trying to have two of them makes n=

>o
>> sense.


>Nonsense. There can be more than one default gateway, and having two
>of them makes perfect sense. For example, one may be a backup in case
>the other interface loses link.


No there cannot be more than one. the system uses the last one exclusively.
There is no fallover either.
Default means default. If nothing else works then use this one. this ONE.



 
Reply With Quote
 
David Schwartz
Guest
Posts: n/a

 
      02-12-2009, 02:49 AM
On Feb 11, 5:10*pm, Unruh <unruh-s...@physics.ubc.ca> wrote:

> No there cannot be more than one. the system uses the last one exclusively.


If the system uses the last one exclusively, then there can be more
than one. Otherwise, there would be no "last one".

> There is no fallover either.


That's not true. The system will not use a default route if its next
hop is unreachable. It would be impossible for it to do so.

> Default means default. If nothing else works then use this one. this ONE.


Correct. And one of the things that might not work is another default
route whose next hop is unreachable.

DS
 
Reply With Quote
 
Unruh
Guest
Posts: n/a

 
      02-12-2009, 03:35 AM
David Schwartz <(E-Mail Removed)> writes:

>On Feb 11, 5:10=A0pm, Unruh <unruh-s...@physics.ubc.ca> wrote:


>> No there cannot be more than one. the system uses the last one exclusivel=

>y.


>If the system uses the last one exclusively, then there can be more
>than one. Otherwise, there would be no "last one".


Lets see 10 years ago I had a default route on my system in California.
Thus the one I have today is not the only one, since I had one 10 years
ago. Ok if that is how you want to use the terms, that's fine by me.
There is only one operative default route at anytime, and that default
route is the last one you set up.

Does that make you happy?



>> There is no fallover either.


>That's not true. The system will not use a default route if its next
>hop is unreachable. It would be impossible for it to do so.


It will use it, and tell you that the next hop is unreachable.


>> Default means default. If nothing else works then use this one. this ONE.


>Correct. And one of the things that might not work is another default
>route whose next hop is unreachable.



wormhole[root]>route add default gw 192.168.0.3
wormhole[root]>ping info
PING info.physics.ubc.ca (142.103.234.23) 56(84) bytes of data.
From wormhole1 (192.168.0.2) icmp_seq=3 Destination Host Unreachable
From wormhole1 (192.168.0.2) icmp_seq=7 Destination Host Unreachable

--- info.physics.ubc.ca ping statistics ---
9 packets transmitted, 0 received, +2 errors, 100% packet loss, time 7999ms


(the computer 192.168.0.3 is switched off, but is on a network
192.168.0.0 0.0.0.0 255.255.255.0 U 10 0 0 eth1


Ie, that network gateway is down, but the system keeps trying.

If I unplug that network cable, then I get
I get the same thing for about 10 sec, at which point that default route is
disconnected. Ie, I believe it is NOT the network software that is "falling
over" but that some helper program is noticing that the network is
disconnected and then disconnecting that default route.




 
Reply With Quote
 
David Schwartz
Guest
Posts: n/a

 
      02-12-2009, 04:28 AM
On Feb 11, 8:35*pm, Unruh <unruh-s...@physics.ubc.ca> wrote:
> David Schwartz <dav...@webmaster.com> writes:
> >On Feb 11, 5:10=A0pm, Unruh <unruh-s...@physics.ubc.ca> wrote:
> >> No there cannot be more than one. the system uses the last one exclusivel=

> >y.
> >If the system uses the last one exclusively, then there can be more
> >than one. Otherwise, there would be no "last one".


> Lets see 10 years ago I had a default route on my system in California.
> Thus the one I have today is not the only one, since I had one 10 years
> ago. Ok if that is how you want to use the terms, that's fine by me.
> There is only one operative default route at anytime, and that default
> route is the last one you set up.


> Does that make you happy?


That is correct only for a strange definition of "operative". Sure,
only one is operative. The other is a backup.

> >> There is no fallover either.

> >That's not true. The system will not use a default route if its next
> >hop is unreachable. It would be impossible for it to do so.


> It will use it, and tell you that the next hop is unreachable.


No, it will not use it.

> >> Default means default. If nothing else works then use this one. this ONE.

> >Correct. And one of the things that might not work is another default
> >route whose next hop is unreachable.

>
> wormhole[root]>route add default gw 192.168.0.3
> wormhole[root]>ping info
> PING info.physics.ubc.ca (142.103.234.23) 56(84) bytes of data.
> From wormhole1 (192.168.0.2) icmp_seq=3 Destination Host Unreachable
> From wormhole1 (192.168.0.2) icmp_seq=7 Destination Host Unreachable
>
> --- info.physics.ubc.ca ping statistics ---
> 9 packets transmitted, 0 received, +2 errors, 100% packet loss, time 7999ms
>
> (the computer 192.168.0.3 is switched off, but is on a network
> 192.168.0.0 * * 0.0.0.0 * * * * 255.255.255.0 * U * * 10 * * 0 * * * *0 eth1
>
> Ie, that network gateway is down, but the system keeps trying.


Correct, because the next hop is not known unreachable. Pull the
network cable.

> If I unplug that network cable, then I get
> I get the same thing for about 10 sec, at which point that default route is
> disconnected. Ie, I believe it is NOT the network software that is "falling
> over" but that some helper program is noticing that the network is
> disconnected and then disconnecting that default route.


You are extrapolating from a very simple setup where something doesn't
work the way you want it to and concluding that it never works.

If the next hop of a default route is known unreachable, the default
route will not be used. Having more than one default routes provides
failover if you have a way to make the next hop on the failed route
unreachable. You can do this many ways. One of them is having an
external routing protocol that controls the reachability of the next
hop. Another way is to have an external routing protocol that controls
the default route itself.

If you have two equally perfectly good default routes, there is
absolutely no reason not to install both of them.

DS
 
Reply With Quote
 
Simon GUEROUT
Guest
Posts: n/a

 
      02-12-2009, 01:21 PM
On Feb 11, 8:17*pm, Tauno Voipio <tauno.voi...@INVALIDiki.fi> wrote:
> Simon GUEROUT wrote:
> > Hello,

>
> > I am trying to have a nice embedded board working, but I can't manage
> > to have internet under special circumstances.

>
> > Let me explain:
> > * The board has 2 interfaces : wireless and ethernet
> > * Both are working perfectly well when used separately
> > * When I have both interfaces on, no internet, can't even ping the
> > DNS...

>
> > The wireless network is 192.168.1.0, gw 192.168.1.1
> > The ethernet network is 192.168.2.0, gw 192.168.2.1

>
> > Routes look like:
> > Destination * * Gateway * * * * Genmask * * * * Flags Metric Ref
> > Use Iface
> > 192.168.3.0 * * * * * * * * * * 255.255.255.0 * U * * 0 * * *0
> > 0 tiwlan0
> > 192.168.2.0 * * * * * * * * * * 255.255.255.0 * U * * 0 * * *0
> > 0 eth0
> > default * * * * 192.168.3.1 * * 0.0.0.0 * * * * UG * *0 * * *0
> > 0 tiwlan0
> > default * * * * 192.168.2.1 * * 0.0.0.0 * * * * UG * *0 * * *0
> > 0 eth0

>
> > My problem disappears if I remove one of the default route.

>
> > => Is it possible to have internet access on both interfaces at the
> > same time ?
> > => Is there a solution that would not require using complicated and
> > specific stuff (ie. something I could trigger automatically when both
> > interfaces are up using a simple script/program) ?

>
> > I do not have a lot of tools on this board (no NetworkManager).
> > BTW, my kernel is a 2.6.10 version, from Montavista on an TI DaVinci
> > processor.

>
> > Thanks!

>
> For any leaf node in the Net, there is only one
> default gateway: For any node, the default gateway
> is the next node toward the rest of the Net.
>
> Which interface do you want to use for the next
> hop toward the Internet?
>
> By the way: What is the 192.168.3.x network?
>
> --
>
> Tauno Voipio
> tauno voipio (at) iki fi


Made a mistake, 192.168.3.X is the wireless network. (I have two
wlans, 192.168.1.X is the other)
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
TCP/IP Multiple gateways (different gateways) Windows (NT, 98, 2000, 2003, XP) goonmunster Windows Networking 1 02-26-2007 08:39 AM
TCP/IP Multiple gateways (different gateways) Windows (NT, 98, 2000, 2003, XP) goonmunster Windows Networking 1 02-26-2007 08:39 AM
NAT with 2 Internet interfaces Tomek Linux Networking 1 04-14-2005 12:00 PM
multiple interfaces to Internet issue David Magda Linux Networking 1 06-11-2004 07:15 AM
2 Gateways for 2 interfaces eole Linux Networking 2 01-08-2004 06:54 PM



1 2 3 4 5 6 7 8 9 10 11