Score:0

Routing traffic from Server A via VPN Server B

ph flag

I have IPSec (Libreswan) Server B (10.0.0.2) and a Server A (10.0.0.1) within the same network. Both servers have only one external network interface. I want to route the packets from Server A with source IP belonging to remote network (192.168.1.1, right side of IPSec) via Server B.

Server A ====> Server B == IPSEC ==> Remote IP

I add a route on server A like:

ip route add 192.168.1.1 via 10.0.0.1

And expect the traffic to be routed automatically in Server B to IPSec tunnel.

Telnet from Server B is okay:

telnet 192.168.1.1 22
Trying 192.168.1.1...
Connected to 192.168.1.1.
Escape character is '^]'.

Telnet from Server A times out:

telnet 192.168.1.1 22
Trying 192.168.1.1...
telnet: connect to address 192.168.1.1: Connection timed out

IP Forwarding is enabled on Server B:

sysctl net.ipv4.ip_forward
net.ipv4.ip_forward = 1

What should I configure on Server B to route traffic from Server A to IPSec tunnel?

in flag
Do you have a route back from the remote network to server a? If you can not control routes on remote net then you might need to do NAT. Otherwise update post with 'ip r' from server b.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.