man brctl
ifconfig -a
ip addr show eth0
tcpdump -nei eth0 arp # stops this
arp -na #shows arp cache
(NEW) add a wi-fi group (at least 2 nics)
for wi-fi and dialup clients to connect to our network (without seeing local users)
see (iwconfig)
###################
# set hostname (see subdomains.txt)
# register hostname
#
#
#
###################
virtual interfaces:
iface eth0:0 inet dhcp
commands can be inserted into scripts:
/etc/network/if-up.d and /etc/network/if-down.d
resolvconf package includes scripts
Write a shell script or network config to:
###################
#re-name all interfaces use businfo
example: ethwan1 businfo 0000:02:04.0
#create the bridges (below)
#zero interfaces if required
#add interfaces to bridges
#span bridges
#add dhcp to private LAN
#
###################
Get the mac addresses (from config table?)
assign ethxx to each mac address
#create the bridges:
brctl addbr br0 # for WAN
brctl addbr br1 # for public LAN
brctl addbr br2 # for private LAN
brctl addbr br3 # for proxy users
# this group only if bridging/bonding dual WAN
brctl addbr br2
ifconfig eth0 0.0.0.0
ifconfig eth1 0.0.0.0
#turn on spanning tree (for multiple bridges)
brctl stp br0 on
brctl stp br1 on
>>> include the shell script in startup
vi /etc/network/interfaces
example:
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface > corrected 4/1/09 ross
auto eth0
iface eth0 inet static
address 216.107.119.2XX
netmask 255.255.255.240
network 216.107.119.2XX
broadcast 216.107.119.2XX
gateway 216.107.119.2XX
dns-nameservers 4.2.2.3
dns-search static.networktel.net
#################################
# TODO TODO TODO TODO TODO TODO #
# TODO TODO TODO TODO TODO TODO #
#################################
write config interfaces and mapping
properly define interfaces by name and mac addresses
using get-mac-address.sh or iftab or udev or ifrename or ethtool
order them so that their position on the back of the unit is logical
old iftab:
/etc/iftab
# This file assigns persistent names to network interfaces.
# See "man iftab" for syntax.
eth0 mac 00:c0:95:e2:6d:e0 arp 1
eth1 mac 00:c0:95:e2:6d:e1 arp 1
eth2 mac 00:c0:95:e2:6d:e2 arp 1
eth3 mac 00:c0:95:e2:6d:e3 arp 1
eth4 mac 00:c0:95:e2:a2:54 arp 1
eth5 mac 00:c0:95:e2:a2:55 arp 1
eth6 mac 00:c0:95:e2:a2:56 arp 1
eth7 mac 00:c0:95:e2:a2:57 arp 1
eth8 mac 00:c0:95:e4:81:28 arp 1
eth9 mac 00:c0:95:e4:81:29 arp 1
eth10 mac 00:c0:95:e4:81:2a arp 1
eth11 mac 00:c0:95:e4:81:2b arp 1
eth12 mac 00:c0:95:e2:8f:cc arp 1
eth13 mac 00:c0:95:e2:8f:cd arp 1
eth14 mac 00:c0:95:e2:8f:ce arp 1
eth15 mac 00:c0:95:e2:8f:cf arp 1
eth16 mac 00:c0:95:e6:59:94 arp 1
eth17 mac 00:c0:95:e6:59:95 arp 1
eth18 mac 00:c0:95:e6:59:96 arp 1
eth19 mac 00:c0:95:e6:59:97 arp 1
eth20 mac 00:c0:95:e2:68:10 arp 1
eth21 mac 00:c0:95:e2:68:11 arp 1
eth22 mac 00:c0:95:e2:68:12 arp 1
eth23 mac 00:c0:95:e2:68:13 arp 1
new iftab:
# This file assigns persistent names to network interfaces.
# See iftab(5) for syntax.
# I used actual pci bus location instead of mac
# so that if nic is replaced it should continue to work.
mapping eth0
script /usr/local/sbin/map-scheme
map HOME eth0-home
map WORK eth0-work
iface eth0-home inet static
address 192.168.1.1
netmask 255.255.255.0
up flush-mail
iface eth0-work inet dhcp
iface eth1 inet dhcp
####################################
#!/bin/sh
# The following script example, if dropped in /etc/network/if-pre-up.d/
# and under /etc/network/if-down.d/, will manage to configure a bridge
# if defined in the /etc/network/interfaces file as either:
#
# Note: The bridge-utils package already provide a similar (more
# powerful) script this is just provided here for convenience and to
# show how the /etc/network/if-*.d/ methods can be defined.
#
# [ a bridge with an associated IP address ]
# iface br0 inet static
# bridge-ifaces eth0 eth1
# address 192.168.1.1
# netmask 255.255.255.0
# [ a bridge which acts as an anonymous bridge ]
# iface br0 inet manual
# bridge-ifaces eth0 eth1
# up ifconfig $IFACE up
#
# For more information read:
# http://bridge.sourceforge.net/howto.html
brctl=`which brctl`
# Notice that the bridge-utils package must be installed and
# we need to have the BRIDGE_IFACES in order to work
[ "$IF_BRIDGE_IFACES" = "" ] && exit 0
if [ -z "$brctl" ] ; then
# ? Somebody is trying to use us without having bridge-utils?
echo "Cannot find the 'brctl' program to setup the bridge"
echo "Hint: Have you installed the bridge-utils package?"
exit 1
fi
# Check all interfaces before proceeding
for i in $IF_BRIDGE_IFACES; do
ip link show $i >/dev/null 2>&1
if [ $? -ne 0 ] ; then
echo "Interface $i is not available, aborting"
exit 1
fi
done
if [ "$MODE" = "start" ] ; then
# We are being called by ifup:
# Bring up all the bridge interfaces
for i in $IF_BRIDGE_IFACES; do
ifconfig $i 0.0.0.0 up
done
# And now add the bridge itself and the interfaces which are part
# of the bridge
brctl addbr $IFACE
for i in $IF_BRIDGE_IFACES; do
brctl addif $IFACE $i
done
elif [ "$MODE" = "stop" ]; then
# We are being called by ifdown:
# Remove the bridge itself and the bridge association
for i in $IF_BRIDGE_IFACES; do
brctl delif $IFACE $i
done
brctl delbr $IFACE
# Bring down all the bridge interfaces
for i in $IF_BRIDGE_IFACES; do
ifconfig $i down
done
fi
#!/bin/sh
#
# Checks if the given interface matches the given ethernet MAC.
# If it does it exits with 0 (success) status;
# if it doesn't then it exists with 1 (error) status.
set -e
export LANG=C
if [ ! "$2" ] ; then
echo "Usage: $0 IFACE targetMAC"
exit 1
fi
iface="$1"
targetmac=`echo "$2" | sed -e 'y/ABCDEF/abcdef/'`
mac=$(/sbin/ifconfig "$iface" | sed -n -e '/^.*HWaddr \([:[:xdigit:]]*\).*/{s//\1/;y/ABCDEF/abcdef/;p;q;}')
if [ "$targetmac" = "$mac" ]; then exit 0; else exit 1; fi
##################################
# SUBNETSUBNETSUBNETSUBNETSUBNET #
# SUBNETSUBNETSUBNETSUBNETSUBNET #
#################################
Here are the IP addresses for the customer. Once the circuit is
installed, these will be available for use.