diff --git a/docs/MultiISP.xml b/docs/MultiISP.xml index 230b85efd..6ed514c4d 100644 --- a/docs/MultiISP.xml +++ b/docs/MultiISP.xml @@ -1322,6 +1322,133 @@ shorewall 2 2 - eth0 192.168.1.254 track,balance=2,optional< 999: from all lookup main 10000: from all fwmark 0x100 lookup ISP1 10001: from all fwmark 0x200 lookup ISP2 + +
+ DHCP with USE_DEFAULT_RT + + When USE_DEFAULT_RT=Yes, you don't want your DHCP client + inserting a default route into the main routing table. + +
+ Debian + + In this Debian-specific example, eth0 is managed by + dhcpcd. + + /etc/default/dhcpcd: + + # Config file for dhcpcd. Note that you have to edit the interface +# name below, or duplicate the configuration for different interfaces. +# If you are editing this file just to get DNS servers set by DHCP, +# then you should consider installing the resolvconf package instead. + +case ${INTERFACE} in +eth0) + +# Uncomment this to allow dhcpcd to set the DNS servers in /etc/resolv.conf +# If you are using resolvconf then you can leave this commented out. +#SET_DNS='yes' + +# Uncomment this to allow dhcpcd to set hostname of the host to the +# hostname option supplied by DHCP server. +#SET_HOSTNAME='yes' + +# Uncomment this to allow dhcpcd to set the NTP servers in /etc/ntp.conf +#SET_NTP='yes' + +# Uncomment this to allow dhcpcd to set the YP servers in /etc/yp.conf +#SET_YP='yes' + +# Add other options here, see man 8 dhcpcd-bin for details. +OPTIONS=(--nogateway --nodns --nontp --script /etc/shorewall/dhcpcd.sh) +;; + +# Add other interfaces here +*) +;; + +esac + + + /etc/shorewall/start: + + cat <<EOF > /var/lib/shorewall/eth0.info +ETH0_GATEWAY=$SW_ETH0_GATEWAY +ETH0_ADDRESS=$SW_ETH0_ADDRESS +EOF + + /etc/shorewall/dhcpd.sh: + + #!/bin/sh + +if [ $2 != down ]; then + if [ -f /var/lib/dhcpcd/dhcpcd-eth0.info ]; then + . /var/lib/dhcpcd/dhcpcd-eth0.info + else + logger -p daemon.err "/var/lib/dhcpcd/dhcpcd-eth0.info does not exist!" + exit 1 + fi + + logger -p daemon.info "DHCP-assigned address/gateway for eth0 is $IPADDR/$GATEWAYS" + + [ -f /var/lib/shorewall/eth0.info ] && . /var/lib/shorewall/eth0.info + + if [ "$GATEWAYS" != "$ETH0_GATEWAY" -o "$IPADDR" != "$ETH0_ADDRESS" ]; then + logger -p daemon.info "eth0 IP configuration changed - restarting lsm and Shorewall" + killall lsm + /sbin/shorewall restart + fi +fi + + + A couple of things to notice about + /etc/shorewall/dhcpcd.sh: + + + + It is hard-coded for eth0 + + + + It assumes the use of LSM; If + you aren't using lSM, you can change the log message and remove + the 'killall lsm' + + + + It restarts Shorewall if the current IPv4 address of eth0 + and the gateway through eth0 are not the same as they were when + Shorewall was last started. + + +
+ +
+ RedHat and Derivatives + + On Redhat-based systems, specify DEFROUTE=No in the device's + ifcfg file. + + /etc/sysconfig/networking/network-scripts/ifcfg-eth2: + + BOOTPROTO=dhcp +PERSISTENT_DHCLIENT=yes +PEERDNS=no +PEERNTP=no +DEFROUTE=no +DHCLIENTARGS="-nc" +DEVICE=eth2 +ONBOOT=yes +
+ +
+ SuSE and Derivatives + + On these systems, set DHCLIENT_SET_DEFAULT_ROUTE=No in the + device's ifcfg file. +
+