Decouple bridge from wireguard role
This commit is contained in:
parent
c470ff8b86
commit
abeaf9fe37
@ -32,6 +32,11 @@ vpn_wireguard_server_preshared_key: "{{ vault_vpn_wireguard_server_preshared_key
|
||||
vpn_wireguard_server_address: "{{ vault_vpn_wireguard_server_address }}"
|
||||
vpn_wireguard_routing_table: 66
|
||||
|
||||
# --------------------------------------------------------------------------------------------------
|
||||
# vpn:bridge
|
||||
# --------------------------------------------------------------------------------------------------
|
||||
vpn_bridge_routing_table: "{{ vpn_wireguard_routing_table }}"
|
||||
|
||||
# --------------------------------------------------------------------------------------------------
|
||||
# backups:snapshots
|
||||
# --------------------------------------------------------------------------------------------------
|
||||
|
@ -22,9 +22,6 @@ argument_specs:
|
||||
vpn_bridge_netmask:
|
||||
type: "str"
|
||||
required: true
|
||||
vpn_wireguard_role:
|
||||
type: "str"
|
||||
required: true
|
||||
vpn_wireguard_routing_table:
|
||||
vpn_bridge_routing_table:
|
||||
type: "int"
|
||||
required: "{{ vpn_wireguard_role == 'client' }}"
|
||||
required: false
|
||||
|
@ -4,14 +4,14 @@ iface br0 inet static
|
||||
|
||||
post-up /usr/local/sbin/post-up-$IFACE-inet.nft
|
||||
post-up /usr/local/sbin/post-up-$IFACE-ipv4.nft
|
||||
{% if vpn_wireguard_role == "client" %}
|
||||
post-up ip rule add dev $IFACE table {{ vpn_wireguard_routing_table }}
|
||||
{% 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_network }} table main priority 1
|
||||
{% endif %}
|
||||
|
||||
{% if vpn_wireguard_role == "client" %}
|
||||
{% if vpn_bridge_routing_table is defined %}
|
||||
pre-down ip rule del dev $IFACE to {{ local_network }} table main priority 1
|
||||
pre-down ip rule del dev $IFACE table {{ vpn_wireguard_routing_table }}
|
||||
pre-down ip rule del dev $IFACE table {{ vpn_bridge_routing_table }}
|
||||
{% endif %}
|
||||
pre-down /usr/local/sbin/pre-down-$IFACE-ipv4.nft
|
||||
pre-down /usr/local/sbin/pre-down-$IFACE-inet.nft
|
||||
|
Loading…
Reference in New Issue
Block a user