Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
two network card merging
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
gentoopewpew
n00b
n00b


Joined: 08 May 2006
Posts: 49

PostPosted: Sun Jun 24, 2007 7:26 pm    Post subject: two network card merging Reply with quote

So
here is my dilemma.
I have two network cards on my gentoo box (eth0 and eth1)
eth0 is my network
i want eth1 to pipe eth0 through, i.e. so i can connect another computer.
is there any other way besides iptables that can do this and is rather easy.
im having trouble with the iptables dnsmasq way.
thanks
Back to top
View user's profile Send private message
didymos
Advocate
Advocate


Joined: 10 Oct 2005
Posts: 4798
Location: California

PostPosted: Sun Jun 24, 2007 8:04 pm    Post subject: Reply with quote

Would ethernet bridging do what you want? It basically just glues two interfaces into a single one, usually called br0. The component interfaces then behave like ports. I use it with one wireless card and an onboard LAN device. Traffic from the other computer connected by wireless is passed back and forth through the DSL modem, and I can surf at the same time, no problem. If so, you'll want to set:
Code:

Networking  --->
  Networking options  --->
    802.1d Ethernet Bridging


in the kernel, module or built-in, and to use it you need to emerge net-misc/bridge-utils. The basic config is really pretty simple. Just see /etc/conf.d/net.example.
_________________
Thomas S. Howard
Back to top
View user's profile Send private message
gentoopewpew
n00b
n00b


Joined: 08 May 2006
Posts: 49

PostPosted: Wed Jun 27, 2007 2:26 am    Post subject: Reply with quote

so u can bridge and use the internet?
i tried bridging once, but what happened was the host couldnt connect to the internet but the client could.
Back to top
View user's profile Send private message
didymos
Advocate
Advocate


Joined: 10 Oct 2005
Posts: 4798
Location: California

PostPosted: Wed Jun 27, 2007 12:44 pm    Post subject: Reply with quote

Umm, yeah. It's how I'm connected right now. Question: when you set it up before, did you give the bridge it's own IP address, or have it assigned one by DHCP (if that's how your setup works)?
_________________
Thomas S. Howard
Back to top
View user's profile Send private message
RoundsToZero
Guru
Guru


Joined: 17 Nov 2003
Posts: 478
Location: New York, NY

PostPosted: Wed Jun 27, 2007 2:24 pm    Post subject: Reply with quote

If you want the bridge machine itself to have net access you do have to make sure the br0 device gets an IP address. DHCP is recommended unless you are already in an environment that uses all static IP's.
Back to top
View user's profile Send private message
yuwy
n00b
n00b


Joined: 22 May 2006
Posts: 38

PostPosted: Thu Jun 28, 2007 8:19 pm    Post subject: Reply with quote

hmm, well I did it the iptables way although its kind of a hassle for first timers. The kernel option for
advanced router needs to be set and the bummer is that you cant have ath_pci mod going on at the same
time or else it kernel panics.

If you just want to make your packets go to and fro from eth0 and eth1 wouldn't just getting a hub do that?
Back to top
View user's profile Send private message
Spoony
Tux's lil' helper
Tux's lil' helper


Joined: 18 Feb 2004
Posts: 99
Location: Washington DC

PostPosted: Thu Jun 28, 2007 9:19 pm    Post subject: Reply with quote

http://gentoo-wiki.com/HOWTO_setup_a_gentoo_bridge

Best place to look....
but a quick and dirty is:

emerge bridge-utils
ln -s /etc/init.d/net.lo /etc/init.d/net.eth0
ln -s /etc/init.d/net.lo /etc/init.d/net.eth1
ln -s /etc/init.d/net.lo /etc/init.d/net.br0

in /etc/conf.d/net
depend_br0() {
need net.eth0 net.eth1
}
bridge_br0="eth0 eth1"
config_eth0=( "null" )
config_eth1=( "null" )
config_br0=( "dhcp" ) or config_br0=( "xxx.xxx.xxx.xxx netmask 255.255.255.0" )
_________________
Regards,
Mike Sponsler
msponsler at gmail.com
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