问题原文
原帖链接 · mariuccio · CC BY-SA 4.0
My raspberry is connected to my lan network 192.168.1.0/24 and it has a static ip. From the outside I can reach it by opening some ports on the ISP router. I have installed an openvpn client on it which creates a tun0 network on 10.8.8.0/24. When the raspberry is connected to the vpn of course I cannot reach it anymore from the outside. How can I reroute the traffic on the local network, so that even if the VPN is connected I can still reach it from the outside?
Thanks a lot in advance
已采纳解答
原帖链接 · RalfFriedl · CC BY-SA 4.0
What you need is policy based routing. Basically, you want answers to packets from outside to go directly back and not to the VPN.
ip rule add from 192.168.1.0/24 table 200
ip route add 192.168.1.0/24 dev eth0 table 200
ip route add default via 192.168.1.1 table 200
This assumes that eth0 is the name of your interface and 192.168.1.1 is the address of your router.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
