After updating the kernel and running pacman –Syu I have a
problem setting VLANs and IPv6 addresses
pogoplug v2 (POGO-E02G)
viewtopic.php?f=58&t=10701
I use a shell script to add VLANs and IPv4 and IPv6 addresses so I can change the addresses by editing a single file
$this->bbcode_second_pass_code('', '
[root@ns02 rsync]# cd /usr/local/bin
[root@ns02 bin]# cat jims-eth-0.sh
#!/bin/sh
sleep 15
rm /tmp/eth.txt
# set eth0 address
ip addr add 192.168.xxx.252/24 broadcast 192.168.xxx.255 dev eth0
ip route add default via 192.168.xxx.1
ip addr add 2001:470:bccf:1::252/64 dev eth0
ip route add default via 2001:470:xxxx:1::1
#
# add vlan 5 to eth0
ip link add link eth0 name eth0.5 type vlan id 5
ip addr add 172.16.www.252/24 brd 172.16.www.255 dev eth0.5
ip addr add 2001:470:xxxx:2::252/64 dev eth0.5
ip link set dev eth0.5 up
# add vlan 7 to eth0
ip link add link eth0 name eth0.7 type vlan id 7
ip addr add 172.16.zzz.252/24 brd 172.16.zzz.255 dev eth0.7
sleep 500
touch /tmp/eth.txt
exit
')
I use a service I created to run the script automatically
$this->bbcode_second_pass_code('', '
[root@ns02 bin]# cd /etc/systemd/system
[root@ns02 system]# ls
getty.target.wants multi-user.target.wants netctl@air3.service stjim.service
[root@ns02 system]# cat stjim.service
[Unit]
Description=My script
[Service]
ExecStart=/usr/local/bin/jims-eth-0.sh
[Install]
WantedBy=multi-user.target
[root@ns02 system]# systenctl status stjim.service
bash: systenctl: command not found
[root@ns02 system]# systemctl status stjim.service
? stjim.service - My script
Loaded: loaded (/etc/systemd/system/stjim.service; enabled; vendor preset: di
Active: inactive (dead) since Mon 2017-01-02 14:36:21 EST; 15s ago
Process: 194 ExecStart=/usr/local/bin/jims-eth-0.sh (code=exited, status=0/SUC
Main PID: 194 (code=exited, status=0/SUCCESS)
Dec 09 20:28:30 ns02 systemd[1]: Started My script.
Dec 09 20:28:45 ns02 jims-eth-0.sh[194]: rm: cannot remove '/tmp/eth.txt': No su
Dec 09 20:28:45 ns02 jims-eth-0.sh[194]: RTNETLINK answers: Operation not suppor
Dec 09 20:28:45 ns02 jims-eth-0.sh[194]: RTNETLINK answers: Operation not suppor
Dec 09 20:28:45 ns02 jims-eth-0.sh[194]: RTNETLINK answers: Operation not suppor
Dec 09 20:28:46 ns02 jims-eth-0.sh[194]: Cannot find device "eth0.5"
Dec 09 20:28:46 ns02 jims-eth-0.sh[194]: Cannot find device "eth0.5"
Dec 09 20:28:46 ns02 jims-eth-0.sh[194]: Cannot find device "eth0.5"
Dec 09 20:28:46 ns02 jims-eth-0.sh[194]: RTNETLINK answers: Operation not suppor
Dec 09 20:28:46 ns02 jims-eth-0.sh[194]: Cannot find device "eth0.7"
')
$this->bbcode_second_pass_code('', '
[root@ns02 rsync]# uname -a
Linux ns02 4.4.39-1-ARCH #1 PREEMPT Wed Dec 21 07:43:11 MST 2016 armv5tel GNU/Linux
[root@ns02 rsync]#
[root@ns02 rsync]# ip ad
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 00:25:31:00:b7:e5 brd ff:ff:ff:ff:ff:ff
inet 192.168.xxx.58/24 brd 192.168.xxx.255 scope global dynamic eth0
valid_lft 172623sec preferred_lft 172623sec
inet 192.168.xxx.252/24 brd 192.168.xxx.255 scope global secondary eth0
valid_lft forever preferred_lft forever
')
I looked at the Man pagesnd can't figure out what I need to change in my script