summaryrefslogtreecommitdiffstats
path: root/iproute2/net.iproute2
blob: d3c9e3c78605ec9ca4685b6bb9ea38d1aa423ecc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/sh
#
# /etc/rc.d/net: start/stop network
#

case $1 in
start)
	# loopback
	/sbin/ip addr add 127.0.0.1/8 dev lo broadcast + scope host
	/sbin/ip link set lo up
	# ethernet
	/sbin/ip addr add 192.168.1.100/24 dev eth0 broadcast +
	/sbin/ip link set eth0 up
	# default route
	/sbin/ip route add default via 192.168.1.1
	;;
stop)
	/sbin/ip route del default
	/sbin/ip link set eth0 down
	/sbin/ip addr del 192.168.1.100/24 dev eth0
	/sbin/ip link set lo down
	/sbin/ip addr del 127.0.0.1/8 dev lo
	;;
restart)
	$0 stop
	$0 start
	;;
*)
	echo "usage: $0 [start|stop|restart]"
	;;
esac

# End of file