LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   bridge (https://www.linuxquestions.org/questions/linux-networking-3/bridge-27059/)

Cubiq 08-02-2002 03:34 PM

bridge
 
i have 2 NICs(TRL8139) eth0(192.168.0.2) and eth1(192.168.0.4) and i want to birdge them. how can i do this?
... if i initalize eth0 the the ping works with the computers connected to it but doesn't work with those connected to eth1 and reverse! any ideea, hint?

krunkwick 08-02-2002 04:08 PM

If it's my understanding, you have 2 subnets. One for each card.

In that case (also assuming that your running a class C network) you will want the cards on diffrent subnets (ie eth0 - 192.168.0.2 and eth1 - 192.168.1.4)

Then you will just have to setup your routing table so the two subnets can talk.

If your trying to bridge two diferent topologies (like ethernet and token ring) then it will still be pretty much the same setup.

turnip 08-02-2002 10:01 PM

If you want to turn 2 interfaces into 1 you need to use teql

modprobe sch_teql


Setup queueing disciplines on each wan interface using iproute2 utility called 'tc'.

tc qdisc add dev eth0 root teql0
tc qdisc add dev eth1 root teql0

The device teql0 is basically a round-robbin distributor over eth0 and eth1, for sending packets. No data ever comes in over an teql device, that just appears on the 'raw' eth0 and eth1.


Set the ip address of teql interface. Note, the ip address used is fake
The reason for this is that packets will be forwarded through this ROUTER, thus packets will never originate from this box.

This means, however, that pinging from this machine will not be possible (your local address if fake).

ip addr add dev teql0 192.168.0.0/31
ip link set teql0 up
ip route del 192.168.0.0/31
ip route add default dev teql0

The default route must be on teql0 device.

This is by no means a how to just some information to look at. You will need to do some research to find out what you need for your machine.

naz 08-03-2002 01:30 AM

The advanced routing howto has a section on building bridges:

http://tldp.org/HOWTO/Adv-Routing-HO....bridging.html

naz

Cubiq 08-03-2002 03:47 AM

ok, krunkwick, i see what you mean, i thought so but i think there is a solution so i keep 192.168.0. on both subnets... something with aliases maybe??? in order to be more specific i'll put a scheme:

192.168.0.3
^
|
|
|eth1 my linux box
|----->192.168.0.4 eth0
192.168.0.2 <------> [switch]
^ ^ ^
| | |
| | |
192.168.0.1 <--------| | |
| |
192.168.0.17 <----------| |
|
192.168.0.27 <-------------|

Cubiq 08-03-2002 03:48 AM

this is a big stupidity(not my fault - entirely) i'll make an image and i'll put it on soon!

RefriedBean 08-03-2002 04:38 AM

Quote:

Originally posted by Cubiq
this is a big stupidity(not my fault - entirely) i'll make an image and i'll put it on soon!
3
Hi!

Tip; use the "[ code]" tags when drawing ascii art. :)

RefriedBean

Cubiq 08-03-2002 07:10 AM

thanks for the tip... ;)
again... the map in ascii version...
Code:

192.168.0.3
        ^
        |
        |
        | eth1  my linux box
        |----->192.168.0.4  eth0
                  192.168.0.2 <------> [switch]
                                                    ^ ^ ^
                                                      |  |  |
                                                      |  |  |
                      192.168.0.1 <--------|  |  |
                                                          |  |
                    192.168.0.17 <----------|  |
                                                            |
                    192.168.0.27 <-------------|

and i made an image also...

LAN.bmp

so... is there any solution so i keep the IPs???

naz 08-04-2002 06:28 AM

from the advanced routing howto, what you want is a Pseudo-bridge, this is explained:

http://www.tldp.org/HOWTO/Adv-Routin...proxy-arp.html

Step by step, quoted from the Adv-Routing-HOWTO:

1. Assign an IP address to both interfaces, the 'left' and the 'right' one
2. Create routes so your machine knows which hosts reside on the left, and which on the right
3. Turn on proxy-ARP on both interfaces, echo 1 > /proc/sys/net/ipv4/conf/ethL/proxy_arp, echo 1 > /proc/sys/net/ipv4/conf/ethR/proxy_arp, where L and R stand for the numbers of your interfaces on the left and on the right side

For further information, please read the Net-HOWTO for information on how to setup network interfaces.

Cubiq 08-10-2002 11:13 AM

could you be more specific at point 2?
here is what i get at route:
Code:

Kernel IP routing table
Destination    Gateway        Genmask        Flags Metric Ref    Use Iface
localnet              *        255.255.255.0    U    0      0        0  eth1
localnet            *          255.255.255.0    U    0      0        0  eth0
loopback          *            255.0.0.0          U    0      0        0    lo

where localnet is 192.168.0.0/255.255.255.0


All times are GMT -5. The time now is 06:41 AM.