summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobby Workman <rworkman@slackware.com>2017-01-06 15:28:39 -0600
committerRobby Workman <rworkman@slackware.com>2017-07-11 16:58:52 -0500
commitf90c679e3ac26bb5047611576850e3253a6c18e2 (patch)
treeffa5fa8f8605f0e3c1d11ef43bef735e5ed24073
parent9e0d5e66956a3b80fb4905c96393216fd4a43988 (diff)
downloadslacknetsetup-f90c679e3ac26bb5047611576850e3253a6c18e2.tar.xz
rc.inet1: Migrate loopback interface code
-rw-r--r--rc.inet115
1 files changed, 8 insertions, 7 deletions
diff --git a/rc.inet1 b/rc.inet1
index 4bd959b..4377b58 100644
--- a/rc.inet1
+++ b/rc.inet1
@@ -51,11 +51,12 @@ fi
# already up, do nothing.
lo_up() {
if grep lo: /proc/net/dev 1> /dev/null ; then
- if ! /sbin/ifconfig | grep "^lo" 1> /dev/null ; then
- echo "/etc/rc.d/rc.inet1: /sbin/ifconfig lo 127.0.0.1" | $LOGGER
- /sbin/ifconfig lo 127.0.0.1
- echo "/etc/rc.d/rc.inet1: /sbin/route add -net 127.0.0.0 netmask 255.0.0.0 lo" | $LOGGER
- /sbin/route add -net 127.0.0.0 netmask 255.0.0.0 lo
+ if ! /sbin/ip | grep "^lo" 1> /dev/null ; then
+ echo "/etc/rc.d/rc.inet1: /sbin/ip ip address add 127.0.0.1/8 dev lo" | $LOGGER
+ /sbin/ip ip address add 127.0.0.1/8 dev lo
+ /sbin/ip link set dev lo up
+ echo "/etc/rc.d/rc.inet1: /sbin/ip route add 127.0.0.0/8 dev lo" | $LOGGER
+ /sbin/ip route add 127.0.0.0/8 dev lo
fi
fi
}
@@ -63,8 +64,8 @@ lo_up() {
# Function to take down the loopback interface:
lo_down() {
if grep lo: /proc/net/dev 1> /dev/null ; then
- echo "/etc/rc.d/rc.inet1: /sbin/ifconfig lo down" | $LOGGER
- /sbin/ifconfig lo down
+ echo "/etc/rc.d/rc.inet1: /sbin/ip link set dev lo down" | $LOGGER
+ /sbin/ip link set dev lo down
fi
}