View previous topic :: View next topic |
Author |
Message |
bigV Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
![](images/avatars/16694627653ef2dac3f3eef.jpg)
Joined: 05 Dec 2002 Posts: 102 Location: Southampton, UK
|
Posted: Tue Jul 08, 2003 8:45 am Post subject: Dual NIC & Routing |
|
|
I have two NIC cards loaded and ready to go. I am having a problem understanding the routing however!!
The routing is as follows
Code: | Destination Gateway Genmask Flags MSS Window irtt Iface
10.24.240.254 10.24.240.5 255.255.255.255 UGH 40 0 0 eth1
10.24.240.0 0.0.0.0 255.255.255.0 U 40 0 0 eth1
10.24.0.0 0.0.0.0 255.255.252.0 U 40 0 0 eth0
127.0.0.0 127.0.0.1 255.0.0.0 UG 40 0 0 lo
0.0.0.0 10.24.2.253 0.0.0.0 UG 40 0 0 eth0
|
my /etc/conf.d/net config is as follows
Code: | iface_eth0="10.24.2.93 broadcast 10.24.3.255 netmask 255.255.252.0"
iface_eth1="10.24.240.5 broadcast 10.24.240.255 netmask 255.255.255.0"
gateway="eth0/10.24.2.253"
|
Why, by default, do the two NICS both use the same default gw. This toally messes the routing up for me and I am unsure how to fix it!!
I have a similar setup on a solris box where the routing is perfect i.e.
Code: | Destination Gateway Flags Ref Use Interf
-------------------- -------------------- ----- ----- ------ ------
172.16.0.0 172.16.0.10 U 1 14585 eri1
10.24.0.0 10.24.2.94 U 1 4401 eri0
224.0.0.0 10.24.2.94 U 1 0 eri0
default 172.16.0.254 UG 1 1797
127.0.0.1 127.0.0.1 UH 8291654586 lo0
|
By default, to get to the 10.24.0.0 network, go to the 10.24.2.94 (local) interface this is good
Also, by default, to get to the 172.16.0.0 network, go via the 172.16.0.10 (local) interface this is also good
Why do I have problems on my Gentoo box - or is it me just being extremely stupid!! please no comments on this one
bigV |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
think4urs11 Bodhisattva
![Bodhisattva Bodhisattva](/images/ranks/rank-bodhisattva.gif)
![](images/avatars/8534934054bad29b51e5fa.jpg)
Joined: 25 Jun 2003 Posts: 6659 Location: above the cloud
|
Posted: Tue Jul 08, 2003 11:00 am Post subject: |
|
|
Hi!
The routing seems to be ok for me
line 1 in routing table
host routing for 10.24.240.254 to 10.24.240.5
line 2
to go to 10.24.240.0/24 use eth1, means everything from 10.24.240.0-10.24.240.255 goes through this NIC
line 3
to go to 10.24.24.0/22 use eth1, means everything from 10.24.0.0-10.24.3.255 goes through this NIC
line 4
local loop
line 5
everything else (Genmask 0.0.0.0) -> throw towards the next station who knows how to route the stuff, means standard gateway 10.24.2.253
BTW:
having a router in the middle of a network range isn't very wise. I always set mine to the outer borders. 10.24.3.254 in that case _________________ Nothing is secure / Security is always a trade-off with usability / Do not assume anything / Trust no-one, nothing / Paranoia is your friend / Think for yourself |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
bigV Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
![](images/avatars/16694627653ef2dac3f3eef.jpg)
Joined: 05 Dec 2002 Posts: 102 Location: Southampton, UK
|
Posted: Tue Jul 08, 2003 11:08 am Post subject: |
|
|
By default though I get the following....
Code: | Destination Gateway Genmask Flags MSS Window irtt Iface
10.24.240.0 0.0.0.0 255.255.255.0 U 40 0 0 eth1
10.24.0.0 0.0.0.0 255.255.252.0 U 40 0 0 eth0
127.0.0.0 127.0.0.1 255.0.0.0 UG 40 0 0 lo
0.0.0.0 10.24.2.253 0.0.0.0 UG 40 0 0 eth0 |
I inserted the following with a route add -net
Code: | 10.24.240.254 10.24.240.5 255.255.255.255 UGH 40 0 0 eth1 |
Which means that both of my interfaces , eth0 and eth1 are using the same default gw i.e. to get to 10.24.240.1 for instance, I have to go to 10.24.2.253 This is not what I want
See what I mean ![Wink :wink:](images/smiles/icon_wink.gif) |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
think4urs11 Bodhisattva
![Bodhisattva Bodhisattva](/images/ranks/rank-bodhisattva.gif)
![](images/avatars/8534934054bad29b51e5fa.jpg)
Joined: 25 Jun 2003 Posts: 6659 Location: above the cloud
|
Posted: Tue Jul 08, 2003 11:28 am Post subject: |
|
|
1. why the 'route add -net'?
If at all this should be -host. OK, the netmask is /32 but who knows...
2.To be honest i don't see your problem
Default gateway is (always, no matter if its Solaris/Windows/xBSD/Linux) last resort. Every packet which has no explicit entry in the routing table is handled by this one. All the others are handled by the according rules
Every packet with dest. ip 10.24.240.0/24 -> eth1
Every packet with dest. ip 10.24.0.0/22 -> eth0
Every packet with dest. ip 127.0.0.0/8 -> local
Every packet 'not handled above' -> default gateway (to be reached over eth0)
i'm just trying to understand your point but up to now this routing is perfectly OK _________________ Nothing is secure / Security is always a trade-off with usability / Do not assume anything / Trust no-one, nothing / Paranoia is your friend / Think for yourself |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
devon l33t
![l33t l33t](/images/ranks/rank_rect_4.gif)
Joined: 23 Jun 2003 Posts: 943
|
Posted: Tue Jul 08, 2003 3:41 pm Post subject: |
|
|
Think4UrS11 wrote: | i'm just trying to understand your point but up to now this routing is perfectly OK |
I believe he is confused because the Gentoo box and the Solaris box outputs the routing data in different formats.
He reads the following
Code: | 10.24.240.0 0.0.0.0 255.255.255.0 U 40 0 0 eth1
0.0.0.0 10.24.2.253 0.0.0.0 UG 40 0 0 eth0 |
as saying "Route 10.24.240.0/24 to 0.0.0.0 which then goes to 10.24.2.253"
bigV: When the Gentoo box needs to send a packet to either 10.24.240.0/24 or 10.24.0.0/22, the box will ARP for the destination's MAC address and then send the packet out the appropriate interface. If the packet is not to either network, it will use the default gateway. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
think4urs11 Bodhisattva
![Bodhisattva Bodhisattva](/images/ranks/rank-bodhisattva.gif)
![](images/avatars/8534934054bad29b51e5fa.jpg)
Joined: 25 Jun 2003 Posts: 6659 Location: above the cloud
|
Posted: Tue Jul 08, 2003 3:50 pm Post subject: |
|
|
so maybe we should write some sort of extension for netstat, shouldn't we?
netstat -rn -"os-style"
where os-style can be
linux / xBSD / Solaris / Windoze / OS390 / graphical / ...
just kidding ![Twisted Evil :twisted:](images/smiles/icon_twisted.gif) _________________ Nothing is secure / Security is always a trade-off with usability / Do not assume anything / Trust no-one, nothing / Paranoia is your friend / Think for yourself |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
bigV Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
![](images/avatars/16694627653ef2dac3f3eef.jpg)
Joined: 05 Dec 2002 Posts: 102 Location: Southampton, UK
|
Posted: Wed Jul 09, 2003 11:58 am Post subject: |
|
|
arse ![Embarassed :oops:](images/smiles/icon_redface.gif) |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
think4urs11 Bodhisattva
![Bodhisattva Bodhisattva](/images/ranks/rank-bodhisattva.gif)
![](images/avatars/8534934054bad29b51e5fa.jpg)
Joined: 25 Jun 2003 Posts: 6659 Location: above the cloud
|
Posted: Wed Jul 09, 2003 5:28 pm Post subject: |
|
|
stay cool
a llittle joke sometimes must be possible
life is to hard without a good sense of black humor ![Smile :)](images/smiles/icon_smile.gif) _________________ Nothing is secure / Security is always a trade-off with usability / Do not assume anything / Trust no-one, nothing / Paranoia is your friend / Think for yourself |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|