Toggle between client and router mode on network interface (Linux)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
430 B

5 years ago
  1. [Unit]
  2. Description=Network interface with static IPv4 (%i)
  3. After=network.target
  4. [Service]
  5. Type=oneshot
  6. RemainAfterExit=yes
  7. EnvironmentFile=/etc/snic/snic-%i.conf
  8. ExecStart=/usr/bin/ip link set %i up
  9. ExecStart=/usr/bin/ip addr flush dev %i
  10. ExecStart=/usr/bin/ip addr add ${snic_sta_addr}/${snic_sta_mask} dev %i
  11. ExecStop=/usr/bin/ip addr flush dev %i
  12. ExecStop=/usr/bin/ip link set %i down
  13. [Install]
  14. WantedBy=multi-user.target