Moved shell scripts

This commit is contained in:
Jake Hillion 2021-04-29 16:54:08 +01:00
parent 1c1615d3c9
commit 8fb4eca4e8
5 changed files with 28 additions and 0 deletions

View File

@ -0,0 +1,2 @@
ifconfig "$CLIENT_INTERFACE" 192.168.1.1 netmask 255.255.255.255
route add "$REMOTE_PORTAL_ADDR" -interface "$CLIENT_INTERFACE"

View File

@ -0,0 +1,8 @@
# Route packets due to the other node via the WAN interface
pass out quick on $ext_if to $rp_ip port { 4725 }
# Else route these packets to the client
pass out quick on $cl_if to $rp_ip
# Route packets due to this node locally
pass in quick on $ext_if from $rp_ip port { 4725 }
# Else route these packets via the tunnel
pass out quick on $nc_if from $rp_ip

View File

@ -0,0 +1,6 @@
# Forward SSH traffic to the host
pass in quick on $ext_if inet proto tcp to ($ext_if) port { 22 }
# Forward proxy traffic to the host
pass in quick on $ext_if inet proto udp to ($ext_if) port { 4725 }
# Forward everything via the netcombiner interface
pass out quick on $nc_if inet to ($ext_if)

View File

@ -0,0 +1,2 @@
ip addr add 192.168.1.1 dev "$CLIENT_INTERFACE"
ip route add "$REMOTE_PORTAL_ADDR" dev "$CLIENT_INTERFACE"

View File

@ -0,0 +1,10 @@
# The local table has priority, so packets for the proxy will be routed correctly
# Add a default route via the other node via the tunnel
ip route add table 20 default via 172.19.152.2 dev nc0
# Use this default route for outbound client packets
ip rule add from "$REMOTE_PORTAL_ADDRESS" iif "$CLIENT_INTERFACE" table 20 priority 20
# Add a route to the client
ip route add table 21 to "$REMOTE_PORTAL_ADDRESS" dev "$CLIENT_INTERFACE"
# Use this route for packets to the remote portal from the tunnel
# Note: there must be a higher priority table for proxy packets
ip rule add to "$REMOTE_PORTAL_ADDRESS" table 21 priority 21