Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Networking & Security
  • Search

2 NICs on same subnet

Having problems getting connected to the internet or running a server? Wondering about securing your box? Ask here.
Post Reply
Advanced search
6 posts • Page 1 of 1
Author
Message
Thalionath
n00b
n00b
Posts: 12
Joined: Mon May 26, 2003 6:07 pm
Location: Switzerland :: Berne

2 NICs on same subnet

  • Quote

Post by Thalionath » Fri Mar 02, 2007 5:28 pm

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: Select all

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: Select all

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: Select all

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: Select all

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
Top
ttuegel
Apprentice
Apprentice
Posts: 176
Joined: Tue Jan 18, 2005 11:05 pm
Location: Illinois, USA

  • Quote

Post by ttuegel » Fri Mar 02, 2007 6:34 pm

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.
Top
HeissFuss
Guru
Guru
Posts: 414
Joined: Tue Jan 11, 2005 3:24 am

  • Quote

Post by HeissFuss » Fri Mar 02, 2007 6:57 pm

Is there a reason you're using 2 NICs on the same subnet instead of a virtual interface?
Top
Thalionath
n00b
n00b
Posts: 12
Joined: Mon May 26, 2003 6:07 pm
Location: Switzerland :: Berne

  • Quote

Post by Thalionath » Fri Mar 02, 2007 7:19 pm

@ttuegel thx

@HeissFuss: No. I'll bond the interfaces together as soon I get access to the box...
Top
Assgier
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 127
Joined: Wed May 28, 2003 12:37 am
Location: Europe -> Netherlands -> Utrecht -> Amersfoort

  • Quote

Post by Assgier » Sat Mar 03, 2007 2:25 pm

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)
Top
Cyker
Veteran
Veteran
Posts: 1746
Joined: Thu Jun 15, 2006 7:43 pm

  • Quote

Post by Cyker » Sat Mar 03, 2007 3:21 pm

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...
Top
Post Reply

6 posts • Page 1 of 1

Return to “Networking & Security”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic