mirror of
https://git.linuxfromscratch.org/lfs.git
synced 2025-03-05 22:04:48 +00:00
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
This commit is contained in:
parent
30e84b015e
commit
9b3c02cac1
@ -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 >> /etc/sysconfig/network << "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>
|
||||
|
Loading…
Reference in New Issue
Block a user