OpenConnect client

  • Encrypt your internet connection to enforce security and privacy.
    • Prevent data leak and traffic spoofing on the client side.
  • Bypass regional restrictions using commercial providers.
    • Escape client side content filters and internet censorship.
  • Access your LAN services remotely without port forwarding.

Install the required packages. Specify the VPN client configuration parameters. Generate server certificate hash.

# Install packages
opkg update
opkg install openconnect
# Configuration parameters

Consider VPN network as public. Assign VPN interface to WAN zone to minimize firewall setup.

# Configure firewall
uci rename firewall.@zone[0]="lan"
uci rename firewall.@zone[1]="wan"
uci del_list"${OC_IF}"
uci add_list"${OC_IF}"
uci commit firewall
/etc/init.d/firewall restart

Set up VPN interface.

# Configure network
uci -q delete network.${OC_IF}
uci set network.${OC_IF}="interface"
uci set network.${OC_IF}.proto="openconnect"
uci set network.${OC_IF}.server="${OC_SERV}"
uci set network.${OC_IF}.port="${OC_PORT}"
uci set network.${OC_IF}.username="${OC_USER}"
uci set network.${OC_IF}.password="${OC_PASS}"
uci set network.${OC_IF}.serverhash="${OC_HASH}"
uci commit network
/etc/init.d/network restart

Configure dynamic connection if necessary.

Establish the VPN connection. Use traceroute and traceroute6 to verify your client traffic is routed via the VPN gateway.


Check your client public IP addresses.

Make sure there is no DNS leak on the client side.

Delegate a public IPv6 prefix to the VPN network to use IPv6 by default.

Collect and analyze the following information.

# Restart services
/etc/init.d/log restart; /etc/init.d/network restart; sleep 10
# Log and status
logread -e openconnect
# Runtime configuration
pgrep -f -a openconnect
ip address show; ip route show table all
ip rule show; iptables-save -c
ip -6 rule show; ip6tables-save -c
# Persistent configuration
uci show network; uci show firewall
This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies
  • Last modified: 2021/09/27 00:55
  • by vgaetera