Skip to content

Commit

Permalink
Merge pull request #83 from bfritz/fix_wireguard_tunnels
Browse files Browse the repository at this point in the history
fix `vpn_routes` script for Alpine 3.19
  • Loading branch information
bfritz authored Apr 29, 2024
2 parents 4c93184 + 9c3cf46 commit 69d1226
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions scripts/genapkovl-rpi-firewall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -166,17 +166,16 @@ add_route() {
local vlan_id="\$2"
local source_ip="\$3"
grep -q "\$table_name" /etc/iproute2/rt_tables || echo "\$vlan_id \$table_name" >> /etc/iproute2/rt_tables
ip -4 rule add iif "eth0.\$vlan_id" table "\$table_name"
ip -4 route add default via "\$source_ip" dev wg0 table "\$table_name"
ip -4 rule add iif "eth0.\$vlan_id" table "\$vlan_id"
ip -4 route add default via "\$source_ip" dev wg0 table "\$vlan_id"
}
del_route() {
local table_name="\$1"
local vlan_id="\$2"
ip -4 route flush table "\$table_name" || true
ip -4 rule del iif "eth0.\$vlan_id" table "\$table_name" || true
ip -4 route flush table "\$vlan_id" || true
ip -4 rule del iif "eth0.\$vlan_id" table "\$vlan_id" || true
}
case "\$1" in
Expand Down

0 comments on commit 69d1226

Please sign in to comment.