Bind local address do specified IP?

Barchan barchan barchan75 at gmail.com
Sun Apr 6 11:11:16 EDT 2014


> Can you describe a circumstance in which you'd want OpenConnect to
> connect from an IP address *other* than the one that it would use by
> default according to the routing tables?

My twisted network configuration:
                                                  /-----------WAN1-------------\
workstation ---LAN--- Router (linux)
 Cisco anyconnect server
workstation2/                              \-----------WAN2--------------/

I run openconnect on workstations, default route is to my dual wan router.
WAN1 is 40/8 Mbit, ping ~130ms to vpn endpoint - good for transfer big files
WAN2 is 2/0.5 Mbit, ping ~7ms  - good for interactive work

I want to choose WAN at vpn startup, without logging to router and
change routing.
I've made routers routing configuration via nettables (ip rule ...
table ..) based on source address. Some address goes through WAN1
only, some through WAN2 only. Rest IPs are balanced with given weight,
but without possibility to guess which wan. "Balanced" IP are defaults
IP and default routing goes through it.

>
> Would you not also need SO_BINDTODEVICE or something similar? And for
> vpnc-script to preserve the route to the VPN server out the *correct*
> interface, rather than the default one as shown by 'ip route get' ?

not it my case, route is the same.



More information about the openconnect-devel mailing list