Friday, April 26, 2024
 Popular · Latest · Hot · Upcoming
5
rated 0 times [  5] [ 0]  / answers: 1 / hits: 7464  / 3 Years ago, mon, may 24, 2021, 8:48:38

At the moment I'm working at a company and the problem is they allow SSH on wifi but not on their wired network. At the moment I push everything through a vpn, but that gives overhead on an already slow network.



I was wondering how I could make all my traffic go through my eth0 but make my ssh connection use wlan0 instead of eth0.



It's important all other traffic goes through eth0 as the wifi here is extremely slow, but just fast enough for a simple shell.


More From » ssh

 Answers
3

Set up eth0 as the default route, set up an alternate route through wlan0, and configure the ssh traffic to go through the alternate route.



Install the iproute package to manipulate routing tables through the ip command. Mark the outgoing packets that you want to re-route, and set up a routing rule to route those packets through a different interface. Untested:



iptables -t mangle -A OUTPUT -p tcp --dport ssh -o eth0 -j MARK --set-mark 1
ip rule add fwmark 1 table 1
ip route add 0.0.0.0/0 table 1 dev wlan0

[#40378] Wednesday, May 26, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
moloy

Total Points: 457
Total Questions: 93
Total Answers: 119

Location: Romania
Member since Wed, Dec 29, 2021
2 Years ago
;