Hello there. I am running openconnect VPN client on an r2s (within a restricted firewall) to connect to a remote server, which runs ocserv that forwards packets to Internet.
openconnect can connect to the remote server successfully. And I double check that all traffic going through the tunnel. However, the traffic can only reach the remote server, not further.
On the remote server, I have set up NAT function like this: sudo iptables -t nat -A POSTROUTING -o eth0 -s 192.168.70.0/24 -j MASQUERADE (70.0 is the network set up by ocserv, and eth0 is the NIC going to the Internet). This NAT setup works well with the Cisco Anyconnect 4.10.01084 iOS version. My iPhone can connect to the ocserv and reach the Internet just fine.
I am really appreciated if someone can provide some help.
One interesting observation is that sometimes the r2s router did manage to get a few packets out (especially after a fresh reboot). For example, I ping www.google.com and received response, and my browser can access www.google.com. But after a while, it stopped working. And traceroute never worked. It stopped at the gateway of the ocserv (192.168.70.1 in this case).
From the client, I can always ping 192.168.70.1 and receive response properly.
@vgaetera , thanks for the tips. I will give it a try later.
I did open the corresponding UDP/TCP port on the server side and decrease the MTU to 1200 on the ocserv. I will see if openwrt also imposes some firewall constraint on r2s.
It took me a while to figure it out. It was due to dns pollution. when I ping from client, the dns returned the wrong IP address. I fixed the issue, by setting the dns server to 8.8.8.8