2022-12-11 00:41:50 +01:00
|
|
|
iface {{ services_service_iface_name }} inet manual
|
|
|
|
pre-up mkdir -p /run/netns
|
2022-12-18 00:05:58 +01:00
|
|
|
pre-up ln -sfTv /proc/$(cat {{ services_service_user_containers }}/pidfile)/ns/net /run/netns/{{ services_service_user_name }}
|
2022-12-11 00:41:50 +01:00
|
|
|
|
|
|
|
pre-up ip link add name $IFACE type veth peer name veth0 netns {{ services_service_user_name }}
|
|
|
|
pre-up ip link set $IFACE master br0
|
|
|
|
|
|
|
|
post-up ip -n {{ services_service_user_name }} link set veth0 up
|
|
|
|
post-up ip -n {{ services_service_user_name }} address add {{ services_service_iface_address }}/24 dev veth0
|
2022-12-12 23:49:20 +01:00
|
|
|
post-up ip -n {{ services_service_user_name }} route add default via {{ services_bridge_gateway }} dev veth0
|
2022-12-11 00:41:50 +01:00
|
|
|
|
2022-12-12 23:49:20 +01:00
|
|
|
pre-down ip -n {{ services_service_user_name }} route del default via {{ services_bridge_gateway }} dev veth0
|
2022-12-11 00:41:50 +01:00
|
|
|
pre-down ip -n {{ services_service_user_name }} address del {{ services_service_iface_address }}/24 dev veth0
|
|
|
|
pre-down ip -n {{ services_service_user_name }} link set veth0 down
|
|
|
|
|
|
|
|
post-down ip link set $IFACE nomaster
|
|
|
|
post-down ip link del dev $IFACE
|
|
|
|
|
|
|
|
post-down rm /run/netns/{{ services_service_user_name }}
|