![如何在哑路由器上设置服务器端 LAN 网关的路由](https://linux22.com/image/1602290/%E5%A6%82%E4%BD%95%E5%9C%A8%E5%93%91%E8%B7%AF%E7%94%B1%E5%99%A8%E4%B8%8A%E8%AE%BE%E7%BD%AE%E6%9C%8D%E5%8A%A1%E5%99%A8%E7%AB%AF%20LAN%20%E7%BD%91%E5%85%B3%E7%9A%84%E8%B7%AF%E7%94%B1.png)
我设置了 OpenVPN 以便从 Internet 访问内部 LAN。在从外部访问的 LAN 机器上,我需要添加以下路由:
sudo ip route add 10.8.0.0/24 via 192.168.0.193
其中 192.168.0.193 是 OpenVPN 服务器。为了访问 LAN 中的所有机器,我需要在 LAN 网关中添加它。但是我的 ISP 路由器/型号似乎没有这样做的选项。您知道其他选择吗?
这里是 server.conf:
port 1194
proto udp
dev tun
ca ca.crt
cert vpnserver.crt
key vpnserver.key # This file should be kept secret
dh dh2048.pem
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push "route 192.168.0.0 255.255.255.0"
push "redirect-gateway def1 bypass-dhcp"
push "dhcp-option DNS 208.67.222.222"
push "dhcp-option DNS 208.67.220.220"
keepalive 10 120
tls-auth ta.key 0 # This file is secret
key-direction 0
cipher BF-CBC # Blowfish (default)
cipher AES-256-CBC # AES
cipher DES-EDE3-CBC # Triple-DES
auth SHA512
user openvpn
group nogroup
persist-key
persist-tun
status openvpn-status.log
log openvpn.log
log-append openvpn.log
verb 3