Last active
January 14, 2020 05:59
-
-
Save dungsaga/fc8bd2662d927f71c9e28f9339aa3775 to your computer and use it in GitHub Desktop.
Access remote host via a specific network interface
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# SSH can access a remote host using a specified network interface | |
# just use -b with local address of that network interface | |
ssh -b 10.20.30.40 [email protected] | |
# add a route to a remote host via a specified network interface | |
sudo ip route add 12.34.56.0/24 via 40.30.20.10 dev wlp2s0 | |
# delete a route in the routing table | |
sudo ip route delete 12.34.56.0/24 | |
# see current routes | |
ip route show | |
route -n |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment