0

My laptop (Ubuntu 18.04.3 LTS) frequently doesn't get ipv6 routing information until I restart radvd on the linux firewaall. Then everything works fine. Any ideas as to how I can get this to work consistantly without manual intervention?

1 Answers1

0

Probably be better to understand how things are breaking, but your question was to restart the service without manual intervention; so that's what I'll work with.

Create a systemd service & timer to execute a script which restarts the radvd service. Copy all the below into a single file onto the Linux GW, chmod 700 the file and execute it using sudo. Obviously change the "24h" to "12h" in the timer part or some other number of hours that suits:

#!/bin/bash

cat <<'EOF'> /root/radvd-restart.sh
#!/bin/bash
#
systemctl restart radvd.service
EOF

cat <<EOF> /etc/systemd/system/radvd-restart.service
[Unit]
Description=Restart radvd Service
[Service]
User=root
Group=root
Type=simple
ExecStart=/bin/bash /root/radvd-restart.sh
[Install]
WantedBy=multi-user.target
EOF

chmod 644 /etc/systemd/system/radvd-restart.service


cat <<EOF> /etc/systemd/system/radvd-restart.timer
[Unit]
Description=Executes /root/radvd-restart.sh every 24 hours
[Timer]
OnUnitInactiveSec=24h
Unit=radvd-restart.service
[Install]
WantedBy=timers.target
EOF

chmod 644 /etc/systemd/system/radvd-restart.timer

systemctl daemon-reload
systemctl enable radvd-restart.service
systemctl enable radvd-restart.timer
systemctl start radvd-restart.service
systemctl start radvd-restart.timer

Again, would be better to understand how things are broken, but this will meet your requirements to stop having to manually kick the service to get it working.

F1Linux
  • 1,256