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?


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 
# /sbin/iptables -A FORWARD -i wg0 -o eth0 -j ACCEPT

Now you can ssh from C

References IP forwarding , NAT.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.