Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Dnsmasq with three ethernet card
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
psychoteur
n00b
n00b


Joined: 26 Jul 2006
Posts: 34

PostPosted: Sun Jun 21, 2009 5:51 pm    Post subject: Dnsmasq with three ethernet card Reply with quote

Hi.
I want to setup a home server.
I use three ethernet card.
Eth0 for wan connected through a modem-lan router. (Intel Pro 100)
Eth1 for lan. Used to connect a old laptop. (Via_rhine)
Eth3 for lan connected with a hub 1g (Linksys 1G realtek r8169)

My problem is :
I'm unable to have eth1 and eth3 both working at the same time.
When I plug a cable into it, I can't get an ip.
Eth3 only works if I don't setup it in rc-update.
Udev issue ???

I set in dnsmasq.conf
Interface=eth1
Interface=eth3

My /etc/conf.d/net

#Intel pro
config_eth0=( "10.0.0.3 brd 10.0.0.255 netmask 255.0.0.0" )
routes_eth0=( "10.0.0.138" )
dns_servers_eth0=( "195.238.2.21 195.238.2.22" )

#Dlink Via_Rhine
config_eth1=( "10.0.0.2 brd 10.0.0.255 netmask 255.0.0.0" )

#Linksys 1G
config_eth3=( "10.0.0.1 brd 10.0.0.0.255 netmask 255.0.0.0")
Back to top
View user's profile Send private message
cyrillic
Watchman
Watchman


Joined: 19 Feb 2003
Posts: 7313
Location: Groton, Massachusetts USA

PostPosted: Sun Jun 21, 2009 8:10 pm    Post subject: Reply with quote

I don't think you need 3 ethernet cards if they are all configured to be on the same subnet. You can do the same thing with just 1 ethernet card.
Back to top
View user's profile Send private message
psychoteur
n00b
n00b


Joined: 26 Jul 2006
Posts: 34

PostPosted: Mon Jun 22, 2009 7:44 am    Post subject: Reply with quote

Hi.
I use one ethernet card by floor. It's strange because dnsmasq is supposed to do those king of thing.
Back to top
View user's profile Send private message
Anarcho
Advocate
Advocate


Joined: 06 Jun 2004
Posts: 2970
Location: Germany

PostPosted: Mon Jun 22, 2009 8:33 am    Post subject: Reply with quote

You can't configure different ethernet cards in the same subnet. The kernel can't decide proparly where to ouput the packets to.

You must configure different subnets, there won't be any other way. Either use something like eth0=10.0.0.1, eth1=10.0.1.1, eth3=10.0.3.1 or if you want all in 10.0.0.x you have to adjust the subnetmask. I would (and have) take the frist approache.
_________________
...it's only Rock'n'Roll, but I like it!
Back to top
View user's profile Send private message
think4urs11
Bodhisattva
Bodhisattva


Joined: 25 Jun 2003
Posts: 6659
Location: above the cloud

PostPosted: Mon Jun 22, 2009 10:55 am    Post subject: Re: Dnsmasq with three ethernet card Reply with quote

psychoteur wrote:
My /etc/conf.d/net
config_eth0=( "10.0.0.3 brd 10.0.0.255 netmask 255.0.0.0" )
#Dlink Via_Rhine
config_eth1=( "10.0.0.2 brd 10.0.0.255 netmask 255.0.0.0" )
#Linksys 1G
config_eth3=( "10.0.0.1 brd 10.0.0.0.255 netmask 255.0.0.0")

Your broadcast and netmask don't match.
Either use 10.255.255.255 as broadcast to match the given netmask or change your netmask to 255.255.255.0.
And with the later don't forget to enable routing when the clients connected to the different interfaces need to talk to each other.
_________________
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
View user's profile Send private message
Carnildo
Guru
Guru


Joined: 17 Jun 2004
Posts: 595

PostPosted: Tue Jun 23, 2009 1:21 am    Post subject: Reply with quote

Anarcho wrote:
You can't configure different ethernet cards in the same subnet. The kernel can't decide proparly where to ouput the packets to.

You must configure different subnets, there won't be any other way.

Yes, there is: set up a bridge containing the two ethernet cards, and assign an IP address to the bridge. You'll need to emerge the "net-misc/bridge-utils" package, and you may need to configure your kernel to support bridging.

A sample /etc/conf.d/net script, based on the one running on my router:
Code:

config_eth1=("null")
config_eth3=("null")

brctl_br0=("stp off")
bridge_br0="eth1 eth3"
config_br0=("192.168.1.1/24")


This gives you a network device named "br0" that you can use just like you'd use "eth1".
Back to top
View user's profile Send private message
psychoteur
n00b
n00b


Joined: 26 Jul 2006
Posts: 34

PostPosted: Tue Jun 23, 2009 8:22 am    Post subject: Reply with quote

Hi again ...
Ok ... I changed my broadcast to 10.255.255.255. No more dhcp on both cards.
I don't have time right now to do full extended tests. I'm a bit in a hurry.
Just a quick question about bridge. If I do a bridge between a 1G card and 100M. The speed will be 100M ?

Thanks.
Back to top
View user's profile Send private message
gentoo-dev
Apprentice
Apprentice


Joined: 24 Jan 2006
Posts: 172

PostPosted: Tue Jun 23, 2009 11:02 am    Post subject: Reply with quote

You neither want nor need bridging. You simply need 3 separate subnets.
http://en.wikipedia.org/wiki/Subnetwork
Back to top
View user's profile Send private message
vaguy02
Guru
Guru


Joined: 25 Feb 2005
Posts: 424
Location: Hopefully in one place

PostPosted: Wed Jun 24, 2009 11:20 am    Post subject: Reply with quote

I agree. You need to setup two different subnets with 255.255.255.0 as your netmask. Once you do this, you should be good.
_________________
Linux Registered User #458185

Intel Quad-Core w/ 4gigs Ram w/ 8800 GTX - Windows 7 RC
2x (Intel Dual-Core w/ 2gigs Ram - Gentoo)
Mac G5 Dual-Core w/ 2gigs Ram - OS 10.5
Back to top
View user's profile Send private message
Carnildo
Guru
Guru


Joined: 17 Jun 2004
Posts: 595

PostPosted: Thu Jun 25, 2009 11:25 pm    Post subject: Reply with quote

psychoteur wrote:

Just a quick question about bridge. If I do a bridge between a 1G card and 100M. The speed will be 100M ?

It'll be 1G on the 1G card and 100M on the 100M card. If you're moving data between the two cards, it'll be 100M because that's how fast the 100M card can accept/supply data.
Back to top
View user's profile Send private message
psychoteur
n00b
n00b


Joined: 26 Jul 2006
Posts: 34

PostPosted: Sat Jun 27, 2009 9:38 am    Post subject: Reply with quote

I know what a subnet is.
But I thing it's weird to setup a old computer as home router and then you have to put a switch or different subnet on each card to work in the same network.
Thanks for the information about the bridge.

What I did I had an old switch. I put in it between the floor. So I use only one card. It's more simple for the iptables config too.
But I still have a problem.
When I try to reach a internet address that doesn't contain ""www". I can't get my page.
I disabled the options : "domain-needed and bogus-private".
So I don't see the problem.
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