Last active
March 5, 2021 05:33
-
-
Save du-song/0d6c3a542c93bee5766286e950d0bd13 to your computer and use it in GitHub Desktop.
Connect Cisco AnyConnect server with OTP in OpenWrt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# use vanilla vpnc instead of the wrapped one in OpenWrt, which handles route table properly | |
wget http://git.infradead.org/users/dwmw2/vpnc-scripts.git/blob_plain/HEAD:/vpnc-script | |
/usr/sbin/openconnect $SERVER -b --script ./vpnc-script -u $USER | |
# update iptables manually instead of UCI | |
iptables -I zone_wan_dest_ACCEPT 5 -o tun0 -j ACCEPT | |
iptables -I FORWARD 5 -i tun0 -j zone_wan_forward | |
iptables -t nat -I POSTROUTING 5 -o tun0 -j zone_wan_postrouting | |
# (optional) add ping in crontab to avoid idle timeout |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment