I am posting my solution for Deja and Google. Perhaps this will
assist someone else.
PRELIMINARIES:
I built a new box (we'll call it ROUTER here) out of spare parts: AMD
K6 233 CPU, 2.8 (approx) gig Maxtor 90288D2 HD, 192 megs RAM and 3
NICs; 3c905B (eth0), DLink (tulip) eth1 and (after everything was
running which we'll get to later) Realtek (8139too) eth2. The AMD K6
233 was a mistake; this setup needs a minimum CPU more like a 500. It
never uses any swap but it too often is at 90+% CPU utilization.
On Router, installed Slackware 10.0. The only services that are
running are (in 'ps xa' order) portmap, inetd, sshd, crond, ostiaryd,
axfrdns and tinydns.
Downloaded the 2.4.29 kernel source, iptables 1.3.0 +
patch-o-matic-ng-20050119, iproute2-2.6.10 and ostiary-1.81b. Also
the daemontools + djbdns + ucspi-tcp stuff for axfrdns + tinydns (but
not dnscache).
Downloaded esfq-0.2 and hacked it so it builds (and runs!) in
iproute2-2.6.10. Posted that hack to the LARTC mailing list.
Downloaded patch-2.4.29-ja1.diff from http://www.ssi.bg/~ja/ because
we are getting an additional DSL connection next week and the patch
helps with multipath routing.
For completeness here: downloaded chklogs-2.0-3 and chkrootkit-0.44.
THE PROBLEM:
In the original setup, any one of the 4 boxes connected to the /29 DSL
WAN could use all the bandwidth and each had to have its own firewall.
There was no way to use more than one ISP without (IMO) unreasonable
complexity.
THE GOAL:
Insert a box ("Router") that listens to all WAN connections, then
firewalls, then forwards the remaining packets to an ethernet switch
where the 4 original boxes connect. It should go without saying that
packets outbound must also be correctly handled. In bridging /
forwarding, Router needs to fairly allocate bandwidth ("QoS") while
not changing the IP address.
ORIGINAL TOPOLOGY:
WAN (DSL) <--->ethernet switch<-->four computers
CURRENT TOPOLOGY:
WAN <--> Router <--> ethernet switch <--> four computers
MY SOLUTION:
I needed a way for Router to listen to all 5 of the IP addresses on
the /29 DSL side, firewall, then forward the remaining packets on to
the 4 computers. I chose to use proxyARP, mainly because it is the
most transparent way to accomplish this. Also, should Router die, I
can just reconnect everything the way it was originally and it will
continue to work. HTB + ESFQ handle the QoS issues, and because
Router is between the WAN and the switch, it can run HTB effectively
on both eth1 (external facing) and eth0 (internal facing), controlling
both upload and download bandwidth. Note that this proxyARP setup
sets both eth1 and eth0 up with the same IP and netmask. Yes, that
does work.
FILES (Beware line wrap!)
(rc.inet1 is disabled. rc.proxyarp replaces it):
/etc/rc.d/rc.proxyarp (called from rc.M.):
#!/bin/bash
# /etc/rc.d/rc.proxyarp - Ethernet setup script for Router
echo "rc.proxyarp: "
# testing
# set -x
# echo -n "rc.proxyarp: " >>/tmp/errors
# definitions
NIC0="3c59x" # eth0 ---> Belkin switch
# eth0 is the internal interface
#NIC1="8139too" # eth1 ---> DSL
NIC1="tulip" # eth1 ---> DSL
IFI="eth0"
IFE="eth1"
IPNS="206.###.89.158"
NWI="206.###.89.152/29" # unused
NMI="255.255.255.248" # unused
GW="206.###.89.153"
BRD="206.###.89.159"
YIC="206.###.89.154/32"
NEWS="206.###.89.155/32"
SON="206.###.89.156/32"
NOP="206.###.89.157/32"
NS="206.###.89.158/32" # unused
# Setup:
ifconfig lo 127.0.0.1
route add -net 127.0.0.0 netmask 255.0.0.0 lo
/etc/rc.d/rc.netdevice
ip link set dev $IFE up
ip address add dev $IFE local $IPNS/32 broadcast $BRD
ip link set dev $IFI up
ip address add dev $IFI local $IPNS/32 broadcast $BRD
ip route add $YIC dev $IFI src $IPNS
ip route add $NEWS dev $IFI src $IPNS
ip route add $SON dev $IFI src $IPNS
ip route add $NOP dev $IFI src $IPNS
ip route add $GW/32 dev $IFE src $IPNS
ip route add 0/0 via $GW dev $IFE src $IPNS
# we want proxyARP:
echo 1 >/proc/sys/net/ipv4/conf/$IFE/proxy_arp
echo 1 >/proc/sys/net/ipv4/conf/$IFI/proxy_arp
# turn on ip forwarding
echo 1 >/proc/sys/net/ipv4/ip_forward
# Re rp_filter: I have decided to leave it off
# turn on antispoofing protection
# for f in /proc/sys/net/ipv4/conf/*/rp_filter; do echo 1 >$f; done
# Shields Up!
/usr/sbin/firewall.sh
# fi
# EOF /etc/rc.d/rc.proxyarp
Here's 'ip route':
206.###.89.154 dev eth0 scope link src 206.###.89.158
206.###.89.155 dev eth0 scope link src 206.###.89.158
206.###.89.153 dev eth1 scope link src 206.###.89.158
206.###.89.156 dev eth0 scope link src 206.###.89.158
206.###.89.157 dev eth0 scope link src 206.###.89.158
127.0.0.0/8 dev lo scope link
default via 206.###.89.153 dev eth1 src 206.###.89.158
Here's 'route -n':
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref
Use Iface
206.###.89.154 0.0.0.0 255.255.255.255 UH 0 0
0 eth0
206.###.89.155 0.0.0.0 255.255.255.255 UH 0 0
0 eth0
206.###.89.153 0.0.0.0 255.255.255.255 UH 0 0
0 eth1
206.###.89.156 0.0.0.0 255.255.255.255 UH 0 0
0 eth0
206.###.89.157 0.0.0.0 255.255.255.255 UH 0 0
0 eth0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0
0 lo
0.0.0.0 206.###.89.153 0.0.0.0 UG 0 0
0 eth1
Here's 'ifconfig':
eth0 Link encap:Ethernet HWaddr 00:10:5A:11:00:A6
inet addr:206.###.89.158 Bcast:206.###.89.159
Mask:255.255.255.255
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:443500 errors:0 dropped:0 overruns:0 frame:0
TX packets:461429 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:339376967 (323.6 Mb) TX bytes:452749889 (431.7 Mb)
Interrupt:9 Base address:0xe800
eth1 Link encap:Ethernet HWaddr 00:4F:4E:00:CC:83
inet addr:206.###.89.158 Bcast:206.###.89.159
Mask:255.255.255.255
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:472954 errors:0 dropped:0 overruns:0 frame:0
TX packets:443399 errors:150 dropped:0 overruns:0
carrier:150
collisions:2265 txqueuelen:1000
RX bytes:453245578 (432.2 Mb) TX bytes:338576759 (322.8 Mb)
Interrupt:10 Base address:0x7000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:390 errors:0 dropped:0 overruns:0 frame:0
TX packets:390 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:33712 (32.9 Kb) TX bytes:33712 (32.9 Kb)
Note for those who say "it doesn't work". Yes, it does work.
However, when I first plugged in the Cat5, I waited ~45 minutes and
never once got an "ARP who has" for any of the 5 external IPs.
Gratituous ARPs were ignored, so I called the ISP and requested they
flush their ARP cache. Within 5 minutes this setup was functional.
Credits, Etc.:
To all those responsible for the links above, thank you!
Blars Blarson. You can't get there from here, so here is where I got
the basic setup for rc.proxyarp http://andthatsjazz.org:8/sapaf.html
Raymond Ingles for ostiary: http://ingles.homeunix.org/software/ost/
Emilio Grimaldo for chklogs:
http://home.iae.nl/users/grimaldo/chklogs.shtml
Nelson Murilo for chklogs: http://www.chkrootkit.org/
LARTC: http://lartc.org/
Here is my HTB + ESFQ QoS script. If you decide to use this,
'fromdos' it first.
ftp://andthatsjazz.org/pub/lartc/ultimate.sh.tar.gz
Bob Sully: The firewall is based on his work.
http://www.malibyte.net/iptables/scripts/fwscripts.html
Here is my firewall script. fromdos it.
ftp://andthatsjazz.org/pub/lartc/firewall.sh.tar.gz
"Thank you" to those who made suggestions in comp.os.linux.networking.
You'll see them as part of this thread. "I'm sorry!" to anyone
missed.
FUTURE:
Next week a second DSL will be installed, so I'll have another
adventure setting up for load balancing and load sharing. That is why
the Realtek NIC is installed but not up. (Anyone want to give me a
good Intel or SMC NIC <grin>?)
--
buck