问题原文
原帖链接 · JonDoe297 · CC BY-SA 3.0
I have two Linux machines connected with a VPN tunnel:
VPN Client <-------> VPN Server
10.74.1.10/24 10.74.1.1/24
Each one has NICs to reach their own networks:
---------> VPN Client <-------------------> VPN Server <------
10.37.0.205/24 10.74.1.10/24 10.74.1.1/24 10.74.0.1/24
And, of course, I have different Linux computers (Linux A, Linux B, etc.) on each network:
Linux A <----> VPN Client <-----> VPN Server <----> Linux B
From VPN Client, I can ping to VPN Server and computers like Linux B.
Although, from Linux A, I can ping to both VPN Client machine's interfaces (10.32.0.205 and 10.74.1.10), it turns out I can't ping to VPN Server with address 10.74.1.1 or to any computer on the network B.
I tried to add a new route on Linux A, but I get this:
$ sudo ip route add 10.74.1.1 via 10.74.1.10 dev eth0
RTNETLINK answers: Network is unreachable
$ sudo ip route add 10.74.1.1 via 10.37.0.205 dev eth0
RTNETLINK answers: Network is unreachable
How can I make this works? Maybe configuring something on VPN Client?
EDIT:
The route table on VPN Client is this:
default via 10.37.0.1 dev eth0
10.37.0.0/24 dev eth0 proto kernel scope link src 10.37.0.205
10.74.0.0/16 via 10.74.1.9 dev tun0
10.74.1.0/24 via 10.74.1.9 dev tun0
10.74.1.9 dev tun0 proto kernel scope link src 10.74.1.10
128.0.0.0/1 via 10.74.1.9 dev tun0
The route table on Linux A:
default via 10.37.1.1 dev eth0
10.37.1.0/24 dev eth0 proto kernel scope link src 10.37.1.217
Also, I activated IP forwarding on VPN Client
$ sudo sysctl -w net.ipv4.conf.all.forwarding=1
EDIT 2:
Filtering packet on VPN Client:
$ sudo iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
已采纳解答
原帖链接 · SYN · CC BY-SA 3.0
What kind of VPN are you using?
Sounds like your VPN Client should NAT traffic from Linux A to your VPN Server & Linux B.
And/or: your Linux B does not have a route back to your VPN Client.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
