尝试从 Linux 服务器为每个 PPTP VPN 用户设置特定的公共 IP

尝试从 Linux 服务器为每个 PPTP VPN 用户设置特定的公共 IP

我有一个 PPTP VPN 服务器。有 5 个用户。我想为每个用户提供一个特定的公共 IP 地址。我一直在尝试使用 iptables 来实现这一点。

IP information

Range: 50.250.█.81 to 50.250.█.85
CIDR Block: 50.250.█.80/29
Gateway IP Address: 50.250.█.86

iptables -t nat -A POSTROUTING -s 192.168.123.102 -o eth0 -j SNAT --to-source 50.250.█.82

我正在使用上述 iptables 规则。我的问题是,PPTP 用户可以连接到 VPN 服务器,但无法使用互联网。我当前的 iptables 规则是 -

iptables -t nat -L -v -n

 pkts bytes target     prot opt in     out     source               destination

Chain INPUT (policy ACCEPT 1931 packets, 121K bytes)
 pkts bytes target     prot opt in     out     source               destination

Chain POSTROUTING (policy ACCEPT 38 packets, 19511 bytes)
 pkts bytes target     prot opt in     out     source               destination
    0     0 SNAT       all  --  *      *       0.0.0.0/0            192.168.123.102      to:50.250.█.82

Chain OUTPUT (policy ACCEPT 7 packets, 482 bytes)
 pkts bytes target     prot opt in     out     source               destination

iptables-save

# Generated by xtables-save v1.8.2 on Mon Oct 25 12:28:21 2021
*filter
:INPUT ACCEPT [749:298243]
:FORWARD ACCEPT [816:328055]
:OUTPUT ACCEPT [421:118874]
COMMIT
# Completed on Mon Oct 25 12:28:21 2021
# Generated by xtables-save v1.8.2 on Mon Oct 25 12:28:21 2021
*nat
:PREROUTING ACCEPT [42:11756]
:INPUT ACCEPT [0:0]
:POSTROUTING ACCEPT [42:11756]
:OUTPUT ACCEPT [0:0]
-A POSTROUTING -s 192.168.123.102/32 -o eth0 -j SNAT --to-source 50.250.█.82
COMMIT
# Completed on Mon Oct 25 12:28:21 2021

ip route ls

default via 50.250.█.86 dev eth0 src 50.250.█.81 metric 202
default via 10.1.10.1 dev wlan0 proto dhcp src 10.1.10.203 metric 303
10.1.10.0/24 dev wlan0 proto dhcp scope link src 10.1.10.203 metric 303
50.250.█.80/29 dev eth0 proto dhcp scope link src 50.250.█.81 metric 202
192.168.123.101 dev ppp0 proto kernel scope link src 192.168.123.1
192.168.123.102 dev ppp1 proto kernel scope link src 192.168.123.1

cat /etc/ppp/chap-secrets

user1 pptpd password 192.168.123.101
user2 pptpd password 192.168.123.102
user3 pptpd password 192.168.123.103
user4 pptpd password 192.168.123.104
user5 pptpd password 192.168.123.105

可能是什么原因?提前致谢。

相关内容