ansible-roles/vpn/bridge/templates/br0

41 lines
1.5 KiB
Plaintext
Raw Normal View History

2022-12-20 19:47:11 +01:00
auto br0
2023-07-27 23:24:41 +02:00
iface br0 inet6 static
2022-12-20 19:47:11 +01:00
pre-up /usr/local/sbin/ip-link-add.sh $IFACE type bridge
post-up /usr/local/sbin/post-up-$IFACE-inet.nft
2023-07-27 23:07:45 +02:00
post-up /usr/local/sbin/post-up-$IFACE-ipv6.nft
2022-12-20 19:47:11 +01:00
{% if vpn_bridge_routing_table is defined %}
2023-07-27 23:07:45 +02:00
post-up ip -6 rule add dev $IFACE table {{ vpn_bridge_routing_table }}
post-up ip -6 rule add dev $IFACE to {{ local_inet6_network }} table main priority 1
2022-12-20 19:47:11 +01:00
{% endif %}
{% if vpn_bridge_routing_table is defined %}
2023-07-27 23:07:45 +02:00
pre-down ip -6 rule del dev $IFACE to {{ local_inet6_network }} table main priority 1
pre-down ip -6 rule del dev $IFACE table {{ vpn_bridge_routing_table }}
2022-12-20 19:47:11 +01:00
{% endif %}
2023-07-27 23:07:45 +02:00
pre-down /usr/local/sbin/pre-down-$IFACE-ipv6.nft
2022-12-20 19:47:11 +01:00
pre-down /usr/local/sbin/pre-down-$IFACE-inet.nft
bridge_stp off
bridge_waitport 0
bridge_fd 0
bridge_ports none
2023-07-27 23:07:45 +02:00
address {{ vpn_bridge_inet6_address }}/{{ vpn_bridge_inet6_prefixlen }}
dad-attempts 0
2023-07-27 23:24:41 +02:00
iface br0 inet static
post-up /usr/local/sbin/post-up-$IFACE-ipv4.nft
{% if vpn_bridge_routing_table is defined %}
post-up ip rule add dev $IFACE table {{ vpn_bridge_routing_table }}
post-up ip rule add dev $IFACE to {{ local_inet_network }} table main priority 1
{% endif %}
{% if vpn_bridge_routing_table is defined %}
pre-down ip rule del dev $IFACE to {{ local_inet_network }} table main priority 1
pre-down ip rule del dev $IFACE table {{ vpn_bridge_routing_table }}
{% endif %}
pre-down /usr/local/sbin/pre-down-$IFACE-ipv4.nft
address {{ vpn_bridge_inet_address }}/{{ vpn_bridge_inet_prefixlen }}