fuxkcsdn
V2EX  ›  问与答

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

  •  
  •   fuxkcsdn · Aug 8, 2014 · 6858 views
    This topic created in 4490 days ago, the information mentioned may be changed or developed.
    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分享给朋友,但这台服务器本身架设在我香港朋友家里的,所以为了保证他家内网的安全,想禁止访问内网。如何配置呢??
    5 replies  •  2014-09-20 14:28:13 +08:00
    jasontse
    jasontse
    Aug 8, 2014 via Android❤️1
    1
    iptables -I FORWARD -i ppp+ -d 192.168.1.0/27 -j DROP
    jasontse
    jasontse
    Aug 8, 2014 via Android
    2
    192.168.1.0/24 打错了
    fuxkcsdn
    fuxkcsdn
    OP
    Aug 8, 2014
    3
    @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
    a88888
    Sep 20, 2014
    4
    可以把你编译好的pdnsd,dnsmasq发我吗
    fuxkcsdn
    fuxkcsdn
    OP
    Sep 20, 2014
    5
    @a88888 entware版本的??
    2个软件目前官方源都有哦,更新一下源看看
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   946 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 21:07 · PVG 05:07 · LAX 13:07 · JFK 16:07
    ♥ Do have faith in what you're doing.