-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathset_interfaces.sh
executable file
·77 lines (69 loc) · 2.34 KB
/
set_interfaces.sh
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/bin/sh
#
# Somewhat simple script to set the local interfaces.
# Works for Mac OS X.
# Also works for FreeBSD.
# $Id$
SYSTEM=`uname -s`
ping -c 1 127.53.53.12
if [ $? != 0 ] ; then
if [ "$SYSTEM" = "Linux" ]; then
INTERFACE=lo
echo "Setting Interfaces"
sudo ifconfig ${INTERFACE}:0 inet 127.53.53.1 \
netmask 255.255.255.255
sudo ifconfig ${INTERFACE}:1 inet 127.53.53.2 \
netmask 255.255.255.255
sudo ifconfig ${INTERFACE}:2 inet 127.53.53.3 \
netmask 255.255.255.255
sudo ifconfig ${INTERFACE}:3 inet 127.53.53.4 \
netmask 255.255.255.255
sudo ifconfig ${INTERFACE}:4 inet 127.53.53.5 \
netmask 255.255.255.255
sudo ifconfig ${INTERFACE}:5 inet 127.53.53.6 \
netmask 255.255.255.255
sudo ifconfig ${INTERFACE}:6 inet 127.53.53.7 \
netmask 255.255.255.255
sudo ifconfig ${INTERFACE}:7 inet 127.53.53.8 \
netmask 255.255.255.255
sudo ifconfig ${INTERFACE}:7 inet 127.53.53.9 \
netmask 255.255.255.255
sudo ifconfig ${INTERFACE}:7 inet 127.53.53.10 \
netmask 255.255.255.255
sudo ifconfig ${INTERFACE}:7 inet 127.53.53.11 \
netmask 255.255.255.255
sudo ifconfig ${INTERFACE}:7 inet 127.53.53.12 \
netmask 255.255.255.255
elif [ "$SYSTEM" = "Darwin" -o "$SYSTEM" = "FreeBSD" ]; then
echo "Setting Interfaces"
INTERFACE=lo0
sudo ifconfig ${INTERFACE} inet 127.53.53.1 \
netmask 255.255.255.255 alias
sudo ifconfig ${INTERFACE} inet 127.53.53.2 \
netmask 255.255.255.255 alias
sudo ifconfig ${INTERFACE} inet 127.53.53.3 \
netmask 255.255.255.255 alias
sudo ifconfig ${INTERFACE} inet 127.53.53.4 \
netmask 255.255.255.255 alias
sudo ifconfig ${INTERFACE} inet 127.53.53.5 \
netmask 255.255.255.255 alias
sudo ifconfig ${INTERFACE} inet 127.53.53.6 \
netmask 255.255.255.255 alias
sudo ifconfig ${INTERFACE} inet 127.53.53.7 \
netmask 255.255.255.255 alias
sudo ifconfig ${INTERFACE} inet 127.53.53.8 \
netmask 255.255.255.255 alias
sudo ifconfig ${INTERFACE} inet 127.53.53.9 \
netmask 255.255.255.255 alias
sudo ifconfig ${INTERFACE} inet 127.53.53.10 \
netmask 255.255.255.255 alias
sudo ifconfig ${INTERFACE} inet 127.53.53.11 \
netmask 255.255.255.255 alias
sudo ifconfig ${INTERFACE} inet 127.53.53.12 \
netmask 255.255.255.255 alias
else
echo "FAILED"
fi
else
echo "Interfaces already configured"
fi