Skip to content

Instantly share code, notes, and snippets.

@troyunverdruss
Created August 11, 2019 19:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save troyunverdruss/fa06019bc22579ed75ebdd8b12b2d1bd to your computer and use it in GitHub Desktop.
Save troyunverdruss/fa06019bc22579ed75ebdd8b12b2d1bd to your computer and use it in GitHub Desktop.
echo 8 custom > /etc/iproute2/rt_tables
ip rule add fwmark 8 table custom
ip route add default via globalip dev vlan2
iptables -A OUTPUT -t mangle -o tun11 -p tcp --sport 2222 -j MARK --set-mark 8
iptables -A PREROUTING -t mangle -s internalip/32 -p tcp --sport 22 -j MARK --set-mark 8
iptables -A PREROUTING -t mangle -s internalip/32 -p udp --sport 1194 -j MARK --set-mark 8
echo 0 > /proc/sys/net/ipv4/conf/vlan2/rp_filter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment