From 9b3c02cac1ed3b2ce2bdd13d5135aefa0d55e588 Mon Sep 17 00:00:00 2001 From: Gerard Beekmans Date: Sun, 29 Apr 2001 19:49:07 +0000 Subject: Added option to select the network interface through which the default gateway can be reached git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@554 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689 --- chapter07/ethnet.xml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'chapter07/ethnet.xml') diff --git a/chapter07/ethnet.xml b/chapter07/ethnet.xml index ac1cca09d..e42e5e868 100644 --- a/chapter07/ethnet.xml +++ b/chapter07/ethnet.xml @@ -18,6 +18,8 @@ following: # # Main script by Gerard Beekmans - gerard@linuxfromscratch.org # GATEWAY check by Jean-François Le Ray - jfleray@club-internet.fr +# "Specify which IF to use to reach default GATEWAY" by +# Graham Cantin - gcantin@pacbell.net # # @@ -59,12 +61,14 @@ case "$1" in # # If the /etc/sysconfig/network file contains a GATEWAY variable, set -# the gateway. +# the default gateway and the interface through which the default +# gateway can be reached. # if [ "$GATEWAY" != "" ]; then echo -n "Setting up routing for eth0 interface..." - /sbin/route add default gw $GATEWAY metric 1 + /sbin/route add default gateway $GATEWAY \ + metric 1 dev $GATEWAY_IF evaluate_retval fi ;; @@ -122,11 +126,15 @@ If a default gateway is required to be setup, the following command does that: cat >> /etc/sysconfig/network << "EOF" GATEWAY=192.168.1.2 +GATEWAY_IF=eth0 EOF -GATEWAY needs to be changed to match the network setup. +GATEWAY and GATEWAY_IF need to be changed to match the network setup. +GATEWAY contains the address of the default gateway, and GATEWAY_IF +contains the network interface through which that default gateway can +be reached. -- cgit v1.2.3-54-g00ecf