## **************************************************************************
## For copyright and licensing terms, see the file named COPYING.
## **************************************************************************

[Unit]
Description=6-to-4 setup/teardown
Before=server.target networking.target

[Service]
Type=oneshot
EnvironmentDirectory=env
ExecStart=route add -inet6 2002:e000:: -prefixlen 20 ::1 -reject
ExecStart=route add -inet6 2002:7f00:: -prefixlen 24 ::1 -reject
ExecStart=route add -inet6 2002:0000:: -prefixlen 24 ::1 -reject
ExecStart=route add -inet6 2002:ff00:: -prefixlen 24 ::1 -reject
ExecStart=ifconfig stf0 create
ExecStart=ifconfig stf0 inet6 "2002:${ipv4}:${slaid}:${ifid}" prefixlen "${prefixlen}"
ExecStopPost=ifconfig stf0 destroy
ExecStopPost=route delete -inet6 2002:e000:: -prefixlen 20 ::1
ExecStopPost=route delete -inet6 2002:7f00:: -prefixlen 24 ::1
ExecStopPost=route delete -inet6 2002:0000:: -prefixlen 24 ::1
ExecStopPost=route delete -inet6 2002:ff00:: -prefixlen 24 ::1
# This is a pseudo-daemon that does not have a running process.
RemainAfterExit=yes
Restart=no

[Install]
WantedBy=workstation.target
