CRUX-ARM : Home

Home :: Documentation :: Download :: Development :: Community :: Ports :: Packages :: Bugs :: Links :: About :: Donors
glibc: updated to 2.24-10
[ports/core-arm64.git] / iproute2 / net.iproute2
CommitLineData
bd9e88bf
VM
1#!/bin/sh
2#
3# /etc/rc.d/net: start/stop network interface
4#
5
6# Connection type: "DHCP" or "static"
7TYPE="DHCP"
8
9# For "static" connections, specify your settings here:
10# To see your available devices run "ip link".
11DEV=enp11s0
12ADDR=192.168.1.100
13MASK=24
14GW=192.168.1.1
15
16# Optional settings:
40973b13 17DHCPOPTS="-t 10"
bd9e88bf
VM
18
19case $1 in
20 start)
21 if [ "${TYPE}" = "DHCP" ]; then
22 /sbin/dhcpcd ${DHCPOPTS}
23 else
24 /sbin/ip addr add ${ADDR}/${MASK} dev ${DEV} broadcast +
25 /sbin/ip link set ${DEV} up
26 /sbin/ip route add default via ${GW}
27 fi
28 ;;
29 stop)
30 if [ "${TYPE}" = "DHCP" ]; then
31 /sbin/dhcpcd -x
32 else
33 /sbin/ip route del default
34 /sbin/ip link set ${DEV} down
35 /sbin/ip addr del ${ADDR}/${MASK} dev ${DEV}
36 fi
37 ;;
38 restart)
39 $0 stop
40 $0 start
41 ;;
42 *)
43 echo "Usage: $0 [start|stop|restart]"
44 ;;
45esac
46
47# End of file
48