fuxkcsdn
V2EX  ›  问与答

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

  •  
  •   fuxkcsdn · Aug 8, 2014 · 6517 views
    This topic created in 4320 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
        1
    jasontse  
       Aug 8, 2014 via Android   ❤️ 1
    iptables -I FORWARD -i ppp+ -d 192.168.1.0/27 -j DROP
    jasontse
        2
    jasontse  
       Aug 8, 2014 via Android
    192.168.1.0/24 打错了
    fuxkcsdn
        3
    fuxkcsdn  
    OP
       Aug 8, 2014
    @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
        4
    a88888  
       Sep 20, 2014
    可以把你编译好的pdnsd,dnsmasq发我吗
    fuxkcsdn
        5
    fuxkcsdn  
    OP
       Sep 20, 2014
    @a88888 entware版本的??
    2个软件目前官方源都有哦,更新一下源看看
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2893 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 39ms · UTC 05:47 · PVG 13:47 · LAX 22:47 · JFK 01:47
    ♥ Do have faith in what you're doing.