Browse Source

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

Gerard Beekmans 24 years ago
parent
commit
9b3c02cac1
1 changed files with 11 additions and 3 deletions
  1. 11 3
      chapter07/ethnet.xml

+ 11 - 3
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:
 <literallayout>
 <userinput>cat &gt;&gt; /etc/sysconfig/network &lt;&lt; "EOF"</userinput>
 GATEWAY=192.168.1.2
+GATEWAY_IF=eth0
 <userinput>EOF</userinput>
 </literallayout>
 
 <para>
-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.
 </para>
 
 </sect2>