I'm trying to set up an OpenConnect VPN server. The server is installed on a machine with a public IP address of 154.154.154.154. VPN server network: 192.168.2.0/24. VPN server listens to port 1234 on the machine. The routing table on the machine (ip route):
default via 154.154.154.1 dev eth0192.168.2.0/24 via 154.154.154.154 dev eth0154.154.154.0/24 dev eth0 proto kernel scope link src 154.154.154.154
A forward is also included:
/etc/sysctl.conf
:net.ipv4.ip_forward = 1
/etc/default/ufw
:DEFAULT_FORWARD_POLICY="ACCEPT"
But it is not possible to access the Internet through a VPN yet. But after executing this command:iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -o eth0 -j MASQUERADE
It turns out, but the traffic comes from the client's device (when logging on 2ip.ru I see the address of the client's provider, not the public address of the machine - 154.154.154.154), and not from the VPN server. How can I make the traffic come from a VPN server?