strongswan VPN 连接上后,如何配置只允许访问外网,不允许访问内网?

2014-08-08 17:27:33 +08:00
 fuxkcsdn
strongSwan IPSec VPN,目前已经配置连接上了

虚拟IP池 10.0.1.0/24,服务器内网IP:192.168.1.100
Chain FORWARD (policy ACCEPT)
target prot opt source destination
ACCEPT all -- 10.0.1.0/24 0.0.0.0/0
Chain POSTROUTING (policy ACCEPT)
target prot opt source destination
SNAT all -- 10.0.1.0/24 0.0.0.0/0 to:192.168.1.100

要把VPN分享给朋友,但这台服务器本身架设在我香港朋友家里的,所以为了保证他家内网的安全,想禁止访问内网。如何配置呢??
6024 次点击
所在节点    问与答
5 条回复
jasontse
2014-08-08 17:37:36 +08:00
iptables -I FORWARD -i ppp+ -d 192.168.1.0/27 -j DROP
jasontse
2014-08-08 17:38:19 +08:00
192.168.1.0/24 打错了
fuxkcsdn
2014-08-08 17:48:16 +08:00
@jasontse THX!
因为我是虚拟IP池的,所以用的是
iptables -A FORWARD -s 10.0.1.0/24 -d 192.168.1.0/24 -j DROP
iptables -A FORWARD -s 10.0.1.0/24 -d 0.0.0.0/0 -j ACCEPT

经测试可以满足我的需求,再次感谢!!
a88888
2014-09-20 11:21:09 +08:00
可以把你编译好的pdnsd,dnsmasq发我吗
fuxkcsdn
2014-09-20 14:28:13 +08:00
@a88888 entware版本的??
2个软件目前官方源都有哦,更新一下源看看

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/126821

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX