Interface service
This commit is contained in:
parent
dbe0d9178a
commit
3a7684ce66
19
etc/systemd/system/netns-interface@.service
Normal file
19
etc/systemd/system/netns-interface@.service
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Named network namespace "%i" network config
|
||||||
|
BindsTo=netns@%i.service
|
||||||
|
After=netns@%i.service
|
||||||
|
StopWhenUnneeded=true
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
RemainAfterExit=yes
|
||||||
|
EnvironmentFile=/etc/systemd/network/netns/netns-%i-interface.conf
|
||||||
|
|
||||||
|
ExecStart=/sbin/ip link add ${ROOT_NS_INTF_NAME}-%i type veth peer name ${IN_NS_INTF_NAME}-%i
|
||||||
|
ExecStart=/sbin/ip link set ${IN_NS_INTF_NAME}-%i netns %i
|
||||||
|
ExecStart=/sbin/ip link set ${ROOT_NS_INTF_NAME}-%i up
|
||||||
|
ExecStart=/sbin/ip netns exec %i ip addr add ${IN_NS_INTF_IP} dev ${IN_NS_INTF_NAME}-%i
|
||||||
|
ExecStart=/sbin/ip netns exec %i ip link set ${IN_NS_INTF_NAME}-%i up
|
||||||
|
ExecStart=/sbin/ip netns exec %i ip link set lo up
|
||||||
|
|
||||||
|
ExecStop=/sbin/ip link del veth0-%i
|
Loading…
Reference in New Issue
Block a user