View previous topic :: View next topic |
Author |
Message |
psychoteur n00b
Joined: 26 Jul 2006 Posts: 34
|
Posted: Sun Jun 21, 2009 5:51 pm Post subject: Dnsmasq with three ethernet card |
|
|
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 |
|
|
cyrillic Watchman
Joined: 19 Feb 2003 Posts: 7313 Location: Groton, Massachusetts USA
|
Posted: Sun Jun 21, 2009 8:10 pm Post subject: |
|
|
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 |
|
|
psychoteur n00b
Joined: 26 Jul 2006 Posts: 34
|
Posted: Mon Jun 22, 2009 7:44 am Post subject: |
|
|
Hi.
I use one ethernet card by floor. It's strange because dnsmasq is supposed to do those king of thing. |
|
Back to top |
|
|
Anarcho Advocate
Joined: 06 Jun 2004 Posts: 2970 Location: Germany
|
Posted: Mon Jun 22, 2009 8:33 am Post subject: |
|
|
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 |
|
|
think4urs11 Bodhisattva
Joined: 25 Jun 2003 Posts: 6659 Location: above the cloud
|
Posted: Mon Jun 22, 2009 10:55 am Post subject: Re: Dnsmasq with three ethernet card |
|
|
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 |
|
|
Carnildo Guru
Joined: 17 Jun 2004 Posts: 595
|
Posted: Tue Jun 23, 2009 1:21 am Post subject: |
|
|
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 |
|
|
psychoteur n00b
Joined: 26 Jul 2006 Posts: 34
|
Posted: Tue Jun 23, 2009 8:22 am Post subject: |
|
|
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 |
|
|
gentoo-dev Apprentice
Joined: 24 Jan 2006 Posts: 172
|
|
Back to top |
|
|
vaguy02 Guru
Joined: 25 Feb 2005 Posts: 424 Location: Hopefully in one place
|
Posted: Wed Jun 24, 2009 11:20 am Post subject: |
|
|
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 |
|
|
Carnildo Guru
Joined: 17 Jun 2004 Posts: 595
|
Posted: Thu Jun 25, 2009 11:25 pm Post subject: |
|
|
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 |
|
|
psychoteur n00b
Joined: 26 Jul 2006 Posts: 34
|
Posted: Sat Jun 27, 2009 9:38 am Post subject: |
|
|
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 |
|
|
|