-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup_worker.sh
More file actions
executable file
·30 lines (25 loc) · 904 Bytes
/
setup_worker.sh
File metadata and controls
executable file
·30 lines (25 loc) · 904 Bytes
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
if [ -z "$1" ]
then
echo "usage: ./setup_worker.sh <IP's last digit>"
exit -1
fi
#deactivate ip v6 in /etc/sysctl.conf on all machines
#echo "net.ipv6.conf.all.disable_ipv6 = 1" >> /etc/sysctl.conf
#echo "net.ipv6.conf.default.disable_ipv6 = 1" >> /etc/sysctl.conf
sysctl -w net.ipv6.conf.default.disable_ipv6=1
sysctl -w net.ipv6.conf.all.disable_ipv6=1
#sysctl -p # apply
#systemctl restart systemd-networkd
### Add local ip address:
ip addr add 192.168.1.10$1/24 dev enp4s0 label enp4s0:0
# add default gateway:
route add default gw 192.168.1.100 enp4s0
# remove old default gateway:
route del default gw 129.13.101.1 dev enp4s0
# mount condor
#mount /dev/md0 /local/scratch/condor
#For testing:
echo "gateway:"
route # 192.168.1.100 has to be default gateway
echo "My ip from outside is:"
curl ifconfig.me # has to be 148