Ubuntu L2TP 서버는 여러 장치 연결을 허용하지 않습니다.

Ubuntu L2TP 서버는 여러 장치 연결을 허용하지 않습니다.

오늘까지 이 웹사이트에서는 문제를 해결하는 몇 가지 답변을 보여 주었습니다. 하지만 이 문제에 대한 정답을 찾지 못한 것 같습니다.

원격 서비스 목적으로 VPN 네트워크에 대한 프로젝트가 있는데, 네트워크가 지속적으로 사용되지는 않습니다. 회사의 온프레미스 서버에 연결하기 위해 내장된 Windows 클라이언트를 설정하기 위해 Windows 클라이언트용 C# 소프트웨어를 개발했습니다.

서버는 Ubuntu 20.04LTS를 실행하며 Strongswan VPN에 2개의 클라이언트가 있도록 설정했습니다.

클라이언트 A와 클라이언트 B는 번거로움 없이 L2TP 서버를 연결할 수 있습니다. 두 클라이언트 모두에서 서버로 핑을 보낼 수 있습니다. A와 B 클라이언트 모두에 연결하려고 하면 서버는 단일 장치만 연결하도록 허용하고 서버에 단일 클라이언트만 ping할 수 있습니다.

클라이언트 A에서 클라이언트 B로 핑이 필요한 것. ufw 방화벽이나 iptables를 설정할 수 없다고 느꼈지만 어디로 따라야 할지 잘 모르겠습니다.

아래 구성:

/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

관련 정보