View previous topic :: View next topic |
Author |
Message |
Tmor n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 10 Mar 2005 Posts: 30
|
Posted: Tue Aug 23, 2005 5:41 pm Post subject: 2 Nics in the same network. Routing problems. |
|
|
Hi,
I have 2 NICs that are both DHCP enabled and I need to be able to talk to them both them. They are both on the same subnet. The problem is in the routing. When DHCP brings up BOTH interfaces it adds 2 default routes. One for each interface on the subnet. This problem only seemed to appear when I started using 2005.1 and the new /etc/conf.d/net parameters.
When no interfaces are up there is only the loopback route.
When one interface (eth0) is up there is a DEFAULT route pointing to the gateway and eth0 is pingable.
Code: | default 10.15.182.1 0.0.0.0 UG 0 0 0 eth0
|
When both interfaces (eth0 and eth1) are up there are 2 DEFAULT gateways and only eth1 is pingable.
Code: | default 10.15.182.1 0.0.0.0 UG 0 0 0 eth0
default 10.15.182.1 0.0.0.0 UG 0 0 0 eth1 |
Ideas? _________________ A day without sunshine is like night... |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
jamapii l33t
![l33t l33t](/images/ranks/rank_rect_4.gif)
![](images/avatars/170100631249065103292e6.jpg)
Joined: 16 Sep 2004 Posts: 637
|
Posted: Tue Aug 23, 2005 5:50 pm Post subject: |
|
|
You can write a postup() shell function in /etc/conf.d/net, that determines the number of default routes, and if it's 2, it removes one of them:
Code: | postup () {
if [ $(route -n | grep '^0\.0\.0\.0' | wc -l) -gt 1 ]; then
# route del gw eth0
# put a command here that removes a default route
fi
} |
But I'm not sure if there's a real problem, and removing a default route solves it.
If it's a wireless and an ethernet lan, I prefer routing over bridging in the access point, then you don't have 2 nics on the same subnet. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Tmor n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 10 Mar 2005 Posts: 30
|
Posted: Tue Aug 23, 2005 11:25 pm Post subject: Script |
|
|
Yes, that would definately solve the problem of the route, but the interface wouldnt be reachable. To complicate matters more, the two nics are in two different switches and all the switches are in the same network.
Am I just missing a fundamental network problem? It would seem that both interfaces should be able to default back to their respective gateways, which in this case is the firewall with the IP 10.x.x.1 and both be active because the have different MAC/IP addresses which the switches can handle. Spanning-Tree is active and there are no loops in the network.
Now if I am in the same subnet I can talk with both interfaces, but any traffic incoming from another subnet cannot. I have duplicated this several times locally and I dont believe its a firewall configuration and I dont want to NAT any external to internal addresses (although I know that would work flawlessly).
Now, I dont have to have DHCP. I can manually define anything.
The network setup kind of looks like this:
Code: |
Router <-> Firewall <-> Switch
|
Switch --- eth0 |
| | Linux Box
Switch --- eth1 |
|
_________________ A day without sunshine is like night... |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Tmor n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 10 Mar 2005 Posts: 30
|
Posted: Sun Sep 04, 2005 3:34 am Post subject: |
|
|
bump. anyone know how to get 2 interfaces active on the same subnet? _________________ A day without sunshine is like night... |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
bigfunkymo Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
![](images/avatars/368859194429737890a944.jpg)
Joined: 23 Jan 2004 Posts: 237
|
Posted: Sun Sep 04, 2005 1:13 pm Post subject: |
|
|
Just out of curiosity, what exactly are you trying to accomplish here? _________________ [No package... Grabbing a set.] |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Taladar Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
Joined: 09 Oct 2004 Posts: 458 Location: Bielefeld, Germany
|
Posted: Sun Sep 04, 2005 6:54 pm Post subject: |
|
|
You are likely to end up with all packages going to one interface anyway if both are on the same logical subnet. To avoid that you would have to change routing to your PC and employ some kind of load balancing. Something like that would be needed for outgoing packages too.
So I second the question "what are you trying to do?" |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
UberLord Retired Dev
![Retired Dev Retired Dev](/images/ranks/rank-retired.gif)
![](images/avatars/16007251014200867ea775c.gif)
Joined: 18 Sep 2003 Posts: 6835 Location: Blighty
|
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|