David: I am finally getting back to this long-delayed project. I have tried to make a script based on your posts that will allow a single network card to route two public IP addresses to two SOHO Apache/DNS/Mail Servers and masquerade PC's on a private SOHO network described above. I'm not a programmer so this probably needs extensive revision. Could you take a look at it?
#!/bin/sh
# A script called /etc/rc.d/rc.br0 to allow a single network card to route
# two public IP addresses to a pair of SOHO Apache/DNS/Mail servers
# based on a post by David Phillips at
#
http://www.linuxquestions.org/questi...threadid=38890
#
# BEFORE RUNNING THIS SCRIPT, TAKE THE FOLLOWING FOUR STEPS
#
# STEP ONE: Back up network boot scripts and create replacements as follows:
# cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth0
.bak
#
# STEP TWO: Create new files for the interfaces and make the srcipt run at boot:
#
# echo DEVICE=eth0 > /etc/sysconfig/network-scripts/ifcfg-eth0
# echo onBOOT=no >> /etc/sysconfig/network-scripts/ifcfg-eth0
# echo DEVICE=eth0:0 > /etc/sysconfig/network-scripts/ifcfg-eth0:0
# echo onBOOT=no >> /etc/sysconfig/network-scripts/ifcfg-eth0:0
# echo DEVICE=br0 > /etc/sysconfig/network-scripts/ifcfg-br0
# echo onBOOT=no >> /etc/sysconfig/network-scripts/ifcfg-br0
# echo "/etc/rc.d/rc.br0" >> /etc/rc.d/rc.local
#
# STEP THREE: Make this script executable, chmod 755 /etc/rc.d/rc.br0
#
# STEP FOUR: Take down the interface before running the script, ifconfig eth0 down
#
# Now the script starts:
echo "#!/bin/sh" > /etc/rc.d/rc.br0
echo "brctl addbr br0" >> /etc/rc.d/rc.br0
echo "brctl addif br0 eth0" >> /etc/rc.d/rc.br0
echo "brctl addif br0 eth0:0" >> /etc/rc.d/rc.br0
echo "ip link set br0 up" >> /etc/rc.d/rc.br0
echo "ip link set eth0 up" >> /etc/rc.d/rc.br0
echo "ip link set eth0:0 up" >> /etc/rc.d/rc.br0
echo "Starting up Interface br0" >> /etc/rc.d/rc.br0
echo "This will take 60 seconds" >> /etc/rc.d/rc.br0
# Now you have THREE OPTIONS.
# OPTION #1:
# Use this if there is dhcp on the network.
#
# echo "dhcpcd br0" >> /etc/rc.d/rc.br0
#
# OPTION #2:
# Use this if the network uses manually assigned ip
# addresses and routing where xxx=the ip of choice and yyy=the
# default gateway. Note: you will need nameservers in /etc/resolv.conf
# for dns to work on this machine.
#
echo "ifconfig br0 xxx.xxx.xxx.xxx" >> /etc/rc.d/rc.br0
echo "route add default gw yyy.yyy.yyy.yyy" >> /etc/rc.d/rc.br0
#
# OPTION #3:
# Don't set an ip, the computer will not have an ip and will be invisible.
#
# Now we are ready to run the script to setup the bridge. You can just
# issue the command, /etc/rc.d/rc.br0 &