With slackware it's fairly easy. Make shure your Kernel has bridging
compiled in. Then try this Note: Everything in *s is commands - type
without the *s:
*ifconfig eth0 0.0.0.0*
*ifconfig eth1 0.0.0.0*
*ifconfig eth2 0.0.0.0*
The above will null all the network cards on your PC - if they are present
with the correct drivers.
ifconfig -> the ifconfig command, a linux standard
eth0-2 -> The NICs
0.0.0.0 -> To Zero the IP and submask
Then:
*brctl addbr br0*
brctl is a bridge config tool. The addbr br0 says to the kernel to add a
bridge called br0. If you run
*ifconfig | more *
after this step you will be able to see your bridge as a NIC.
Then:
*brctl addif br0 eth0 eth1 eth2*
This tells the kernel to add eth0 eth1 and eth2 network interfaces (the
addif) to br0.
Then:
*ifconfig br0 192.168.0.254*
Change the above IP address to whatever your bridge's IP should be.
You should now be able to connect the your PC's to your linux box and use it
as a bridge - but remember the cables have to be CROSSOVER cables,
otherwise it won't work.
You can put all this into a nice script aswell:
Copy and paste the following (without the -----s) into a file, make it
executable (chmod +x the-file-name) and put it in your system startup. In
slackware add a entry to /etc/rc.d/rc.local to point to your script.
-------------------------------------------------------
#!/bin/sh
#Script to create Bridge
#Quickly written by Constant Meiring
#Config Part
###################################
ETHS="eth0 eth1 eth2 eth3"
BRIDGE_NAME="br0"
BRIDGE_IP="192.168.0.254"
###################################
#Null the NICs
echo Nulling NICs
for ETH_NR in `echo $ETHS`; do
echo " -> " "`echo $ETHNR`"
ifconfig $ETH_NR 0.0.0.0
done
echo Creating Bridge
brctl addbr $BRIDGE_NAME
echo Adding NICs to Bridge
brctl addif $BRIDGE_NAME $ETHS
echo Adding IP to Bridge
ifconfig $BRIDGE_NAME $BRIDGE_IP
echo Done
#EOF
---------------------------------------------------------
Hope this helped.
Constant Meiring
--
----------------------------
Slackware - bcoz we can
----------------------------