I have a machine C which I can SSH into from my machine B. But when C uses Wireguard to connect to the internet through machine A, I no longer can SSH into it from B. What do I do?
Asked
Active
Viewed 2,696 times
1 Answers
0
That's because now you are no longer on the private network you have created 10.0.0.x .
You have two option one ssh machine B from machine A , or wireguard machine C with B to and ssh
then you have to enable ip forwarding:
# echo 1 > /proc/sys/net/ipv4/ip_forward
# /sbin/iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
# /sbin/iptables -A FORWARD -i eth0 -o wg0 -m state --state RELATED,ESTABLISHED
-j ACCEPT
# /sbin/iptables -A FORWARD -i wg0 -o eth0 -j ACCEPT
Now you can ssh from C
References IP forwarding , NAT.
amryadam
- 1
- 1