Ubuntu L2TP 伺服器不允許連接多個設備

Ubuntu L2TP 伺服器不允許連接多個設備

直到今天,這個網站向我展示了一些解決問題的答案。但我似乎找不到這個問題的正確答案。

我有一個用於遠端服務目的的 VPN 網路項目,該網路不會經常使用。我為 Windows 用戶端開發了 C# 軟體,用於設定內建 Windows 用戶端以連接到公司的本機伺服器。

伺服器運行 Ubuntu 20.04LTS,我設定了 Strongswan VPN,上面有 2 個客戶端。

客戶端A和客戶端B可以輕鬆連接L2TP伺服器。我可以從兩個客戶端 ping 到伺服器。當我嘗試連接 A 和 B 客戶端時,伺服器只允許單一裝置連接,並且我只能對單一客戶端執行 ping 操作。

我需要從客戶端 A ping 到客戶端 B。

配置如下:

/etc/ipsec.secrets

192.168.0.17 %any : PSK "xpasswordx"

/etc/ppp/chap-secrets

userclientA * xpassx 192.168.30.10
userclientB * xpassx 192.168.30.11

/etc/ipsec.conf

config setup
conn L2TP-PSK-noNAT
        dpdaction=clear
        authby=secret
        auto=add
        keyingtries=3
        ikelifetime=8h
        keylife=1h
        keyexchange = ikev1
        ike=aes256-aes192-aes128-sha384-sha256-sha1-modp2048-modp1536-modp1024!
        type=transport
        left=192.168.0.17
        leftprotoport=17/1701
        right=%any
        rightprotoport=17/%any

/etc/xl2tpd/xl2tpd.conf

    [global]
    ipsec saref = yes
    saref refinfo = 30
    ;debug avp = yes
    ;debug network = yes
    ;debug state = yes
    ;debug tunnel = yes
    [lns default]
    ip range = 192.168.30.2-192.168.30.254
    local ip = 192.168.30.1
    refuse pap = yes
    require authentication = yes
    ;ppp debug = yes
    pppoptfile = /etc/ppp/options.xl2tpd
    length bit = yes

/etc/ppp/options.xl2tpd
    
    logfd 2
    logfile /var/log/xl2tpns.log
    refuse-mschap-v2
    refuse-mschap
    ms-dns 8.8.8.8
    ms-dns 8.8.4.4
    asyncmap 0
    auth
    crtscts
    idle 1800
    mtu 1200
    mru 1200
    lock
    hide-password
    local
    #debug
    name l2tpd
    proxyarp
    lcp-echo-interval 30
    lcp-echo-failure 4

iptables -L

Chain INPUT (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     udp  --  anywhere             anywhere             policy match dir in pol ipsec udp dpt:l2f

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination 

/etc/sysctl.conf

net.ipv4.ip_forward = 1
net.ipv4.conf.all.accept_redirects = 0
net.ipv4.conf.all.send_redirects = 0
net.ipv4.conf.default.rp_filter = 0
net.ipv4.conf.default.accept_source_route = 0
net.ipv4.conf.default.send_redirects = 0
net.ipv4.icmp_ignore_bogus_error_responses = 1

相關內容