Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
2 NICs on same subnet
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Thalionath
n00b
n00b


Joined: 26 May 2003
Posts: 12
Location: Switzerland :: Berne

PostPosted: Fri Mar 02, 2007 5:28 pm    Post subject: 2 NICs on same subnet Reply with quote

Hi all

I have a gentoo box, which is connected with 2 network cards to the same subnet.

eth0 192.168.1.10/24
eth1 192.168.1.11/24

Yesterday, I finally decided to update my /etc/conf.d/net

from the old syntax:

Code:

iface_eth0="192.168.1.10 broadcast 192.168.1.255 netmask 255.255.255.0"
iface_eth1="192.168.1.11 broadcast 192.168.1.255 netmask 255.255.255.0"
gateway="eth0/192.168.1.1"


(has been working for 2 years)

to the new syntax:

Code:

config_eth0=( "192.168.1.10/24 brd 192.168.1.255" )
routes_eth0=( "default via 192.168.1.1" )

config_eth1=( "192.168.1.11/24 brd 192.168.1.255" )
routes_eth1=( "default via 192.168.1.1" )


Code:

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.1.1  *               255.255.255.0 U     0      0        0 eth0
192.168.1.1  *               255.255.255.0 U     0      0        0 eth1
loopback        *               255.0.0.0       U     0      0        0 lo
default         192.168.1.1  0.0.0.0         UG    0      0        0 eth1
default         192.168.1.1  0.0.0.0         UG    0      0        0 eth0


Now I've the problem, that only one of the two works at a time.

It seams somehow logically to me, that only one can be working with 2 default gateways in the routing table. But why and how worked it with the old
config?

Would it make more sense to bond the interfaces together?

Code:

slaves_bond0="eth0 eth1"

config_bond0=( "192.168.1.10/24 brd 192.168.1.255" "192.168.1.11/24 brd 192.168.1.255" )
routes_bond0=( "default via 192.168.1.1" )


thx
Back to top
View user's profile Send private message
ttuegel
Apprentice
Apprentice


Joined: 18 Jan 2005
Posts: 176
Location: Illinois, USA

PostPosted: Fri Mar 02, 2007 6:34 pm    Post subject: Reply with quote

Yes, you'll want to bond the interfaces since they're on the same subnet. That will give you the result you're looking for.
Back to top
View user's profile Send private message
HeissFuss
Guru
Guru


Joined: 11 Jan 2005
Posts: 414

PostPosted: Fri Mar 02, 2007 6:57 pm    Post subject: Reply with quote

Is there a reason you're using 2 NICs on the same subnet instead of a virtual interface?
Back to top
View user's profile Send private message
Thalionath
n00b
n00b


Joined: 26 May 2003
Posts: 12
Location: Switzerland :: Berne

PostPosted: Fri Mar 02, 2007 7:19 pm    Post subject: Reply with quote

@ttuegel thx

@HeissFuss: No. I'll bond the interfaces together as soon I get access to the box...
Back to top
View user's profile Send private message
Assgier
Tux's lil' helper
Tux's lil' helper


Joined: 28 May 2003
Posts: 127
Location: Europe -> Netherlands -> Utrecht -> Amersfoort

PostPosted: Sat Mar 03, 2007 2:25 pm    Post subject: Reply with quote

Should the bond not work; when comparing your old config against your current one, note that in your old config you only specify a gateway for eth0 while, in your current one, you specify the same gateway for both NIC's. It could be the issue :)
_________________
8)
Back to top
View user's profile Send private message
Cyker
Veteran
Veteran


Joined: 15 Jun 2006
Posts: 1746

PostPosted: Sat Mar 03, 2007 3:21 pm    Post subject: Reply with quote

Yeah; In the original config eth0 is the only one with a default gateway, but in the new config you gave both eth0 and eth1 the gateway.
I think that's why one of them gets disabled - To avoid creating a loop (And thus a Happy Fun Packet Storm!(tm))

Just delete the routes_eth1=( "default via 192.168.1.1" ) line...
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum