View previous topic :: View next topic |
Author |
Message |
gentoopewpew n00b
Joined: 08 May 2006 Posts: 49
|
Posted: Sun Jun 24, 2007 7:26 pm Post subject: two network card merging |
|
|
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 |
|
|
didymos Advocate
Joined: 10 Oct 2005 Posts: 4798 Location: California
|
Posted: Sun Jun 24, 2007 8:04 pm Post subject: |
|
|
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 |
|
|
gentoopewpew n00b
Joined: 08 May 2006 Posts: 49
|
Posted: Wed Jun 27, 2007 2:26 am Post subject: |
|
|
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 |
|
|
didymos Advocate
Joined: 10 Oct 2005 Posts: 4798 Location: California
|
Posted: Wed Jun 27, 2007 12:44 pm Post subject: |
|
|
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 |
|
|
RoundsToZero Guru
Joined: 17 Nov 2003 Posts: 478 Location: New York, NY
|
Posted: Wed Jun 27, 2007 2:24 pm Post subject: |
|
|
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 |
|
|
yuwy n00b
Joined: 22 May 2006 Posts: 38
|
Posted: Thu Jun 28, 2007 8:19 pm Post subject: |
|
|
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 |
|
|
Spoony Tux's lil' helper
Joined: 18 Feb 2004 Posts: 99 Location: Washington DC
|
Posted: Thu Jun 28, 2007 9:19 pm Post subject: |
|
|
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 |
|
|
|