local parameter is not working in client mode

This forum is for admins who are looking to build or expand their OpenVPN setup.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Forum rules
Please use the [oconf] BB tag for openvpn Configurations. See viewtopic.php?f=30&t=21589 for an example.
Post Reply
kerozcak
OpenVpn Newbie
Posts: 3
Joined: Mon Nov 29, 2010 6:57 pm

local parameter is not working in client mode

Post by kerozcak » Mon Nov 29, 2010 7:00 pm

This is because there's bind_local set to false in client mode (socket.c:1014), which prevents resolve_bind_socket function to execute bind() (socket.c:742) to bind a socket to the choosen address. Why bind() is turned off in client mode anyway?

User avatar
krzee
Forum Team
Posts: 728
Joined: Fri Aug 29, 2008 5:42 pm

Re: local parameter is not working in client mode

Post by krzee » Tue Nov 30, 2010 10:08 am

because clients dont listen for connections

kerozcak
OpenVpn Newbie
Posts: 3
Joined: Mon Nov 29, 2010 6:57 pm

Re: local parameter is not working in client mode

Post by kerozcak » Tue Nov 30, 2010 2:41 pm

bind() is not used to listen for connection, listen() is. bind() is used to bind a socket to the address (in example ssh is using it for -b option). I had to manually remove the if (socket.c:742) to make it work for client mode in openvpn. So again, why it's turned off in client mode?

User avatar
krzee
Forum Team
Posts: 728
Joined: Fri Aug 29, 2008 5:42 pm

Re: local parameter is not working in client mode

Post by krzee » Wed Dec 01, 2010 2:49 am

oh ok... you wanted --lport

kerozcak
OpenVpn Newbie
Posts: 3
Joined: Mon Nov 29, 2010 6:57 pm

Re: local parameter is not working in client mode

Post by kerozcak » Wed Dec 01, 2010 5:41 am

No... i wanted --local, port doesn't matter to me.

Post Reply