Skip to content

Instantly share code, notes, and snippets.

@MitchRatquest
Created May 2, 2019 21:36
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 MitchRatquest/f845417331779dfb49b7cd51e1b50c23 to your computer and use it in GitHub Desktop.
Save MitchRatquest/f845417331779dfb49b7cd51e1b50c23 to your computer and use it in GitHub Desktop.
general routing setup
#!/bin/bash
#assuming appliance is a dns server on another network
#and you want to be able to talk to those clients on that network
#and you can ssh into the appliance
#this might be useful if you dont want to use iptables
appliance="192.168.100.76"
route add -net 172.18.0.0 netmask 255.255.0.0 gw "$appliance"
ssh root@"$appliance" route add -net 172.18.0.0 netmask 255.255.0.0 gw 172.18.0.1; echo "1" > /proc/sys/net/ipv4/ip_forward;
#should you need to delete the route, use this:
route del -net 172.18.0.0 netmask 255.255.0.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment