From a44b3747ddc395f5222978ab71b05d235c0c291a Mon Sep 17 00:00:00 2001 From: Jake Hillion Date: Wed, 20 Jan 2021 13:37:15 +0000 Subject: [PATCH] script compatability fixes --- README.md | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 1cf9600..7a67939 100644 --- a/README.md +++ b/README.md @@ -4,11 +4,11 @@ ### Linux #### Policy Based Routing - ip route flush 10 + ip route flush table 10 ip route add table 10 to 1.1.1.0/24 dev eth1 ip rule add from 1.1.1.4 table 10 priority 10 - ip route flush 11 + ip route flush table 11 ip route add table 11 to 1.1.1.0/24 dev eth2 ip rule add from 1.1.1.5 table 11 priority 11 @@ -37,16 +37,16 @@ These are functional setup scripts that make the application run as intended on ## Transfer the local routing table to a much lower priority (ip rule show | grep '20:') > /dev/null || ip rule add from all table local priority 20 - ip rule del 0 2> /dev/null || true + ip rule del priority 0 2> /dev/null || true ## Ports to route locally ### MPBL3P - ip rule del 1 2> /dev/null || true + ip rule del priority 1 2> /dev/null || true ip rule add to "$REMOTE_PORTAL_ADDRESS" dport 1234 table local priority 1 ### SSH - ip rule del 2 2> /dev/null || true + ip rule del priority 2 2> /dev/null || true ip rule add to "$REMOTE_PORTAL_ADDRESS" dport 22 table local priority 2 #### Post-Start @@ -62,9 +62,9 @@ These are functional setup scripts that make the application run as intended on ip link set up nc0 # Route packets to the interface but not for nc via the tunnel - ip route flush 19 + ip route flush table 19 ip route add table 19 to "$REMOTE_PORTAL_ADDRESS" via 172.19.152.3 dev nc0 - ip rule del 19 2> /dev/null || true + ip rule del priority 19 2> /dev/null || true ip rule add to "$REMOTE_PORTAL_ADDRESS" table 19 priority 19 ### Local Portal @@ -85,21 +85,22 @@ These are functional setup scripts that make the application run as intended on sysctl -w net.ipv4.ip_forward=1 ## Gateway Interface Setup + ip addr flush dev "$GATEWAY_INTERFACE" ip addr add "$GATEWAY_ADDRESS"/32 dev "$GATEWAY_INTERFACE" ip link set up "$GATEWAY_INTERFACE" ## Per-Interface Routing Tables ### 10.10.0.0/24 - ip route flush 10 + ip route flush table 10 ip route add table 10 default via 10.10.0.1 - ip rule del 10 2> /dev/null || true + ip rule del priority 10 2> /dev/null || true ip rule add from 10.10.0.0/24 table 10 priority 10 ### 192.168.0.0/24 - ip route flush 11 + ip route flush table 11 ip route add table 11 default via 192.168.0.1 - ip rule del 11 2> /dev/null || true + ip rule del priority 11 2> /dev/null || true ip rule add from 192.168.0.0/24 table 11 priority 11 #### Post-Start @@ -116,15 +117,15 @@ These are functional setup scripts that make the application run as intended on ip link set up nc0 ## Route Outbound Packets Correctly - ip route flush 20 + ip route flush table 20 ip route add table 20 default via 172.19.152.2 dev nc0 - ip rule del 20 2> /dev/null || true + ip rule del priority 20 2> /dev/null || true ip rule add from "$REMOTE_PORTAL_ADDRESS" iif "$GATEWAY_INTERFACE" table 20 priority 20 ## Route Inbound Packets Correctly - ip route flush 21 + ip route flush table 21 ip route add table 21 to "$REMOTE_PORTAL_ADDRESS" dev "$GATEWAY_INTERFACE" - ip rule del 21 2> /dev/null || true + ip rule del priority 21 2> /dev/null || true ip rule add to "$REMOTE_PORTAL_ADDRESS" table 21 priority 21 #### Client