How to specify the name of interface to listen on, instead of the IP ?
Posted: Tue Jun 21, 2016 7:49 am
Hi, guys.
Is there any way to specify the name of the interface to listen on, instead of to specify the IP of the interface ?
In both side (server and client) of my case, the IPs are all dynamic (assigned by ISP).
I use some ddns tool to refresh(register) the new ip of both.
Yes, they all have their own dns name !
Obviously, it's necessary to config the "--remote" with the dns name of server on client side, instead of the ip of the server.
But my server has more than one Internet link.
While openwrt is starting, the sddns.sh script has not yet re-register the new ip related to it's dns name.
At the same time, OpenVPN trys to resolve the ip of this dns name and to listen on this ip specified by old registering.
So, it fails inevitably (trys to listen a ip not belong to it).
Casually, it sometimes successfully listened on a IP, but not the correct ip related to the dns name (the ip belongs to another internet link).
A few minutes later, after sddns.sh refresh the correct ip successfully, the clients can not establish vpn through the dns name of my server.
Considering security reasons, I don't like listen on all my interface.
So, I want to start the openvpn server, and force it listen on a fixed interface such as "pppoe-wan1" in my case.
Then, I will config the sddns.sh script to bind the ip of this fixed interface to the dns name always.
Is there existing this way ?
Thanks!
Is there any way to specify the name of the interface to listen on, instead of to specify the IP of the interface ?
In both side (server and client) of my case, the IPs are all dynamic (assigned by ISP).
I use some ddns tool to refresh(register) the new ip of both.
Yes, they all have their own dns name !
Obviously, it's necessary to config the "--remote" with the dns name of server on client side, instead of the ip of the server.
But my server has more than one Internet link.
While openwrt is starting, the sddns.sh script has not yet re-register the new ip related to it's dns name.
At the same time, OpenVPN trys to resolve the ip of this dns name and to listen on this ip specified by old registering.
So, it fails inevitably (trys to listen a ip not belong to it).
Casually, it sometimes successfully listened on a IP, but not the correct ip related to the dns name (the ip belongs to another internet link).
A few minutes later, after sddns.sh refresh the correct ip successfully, the clients can not establish vpn through the dns name of my server.
Considering security reasons, I don't like listen on all my interface.
So, I want to start the openvpn server, and force it listen on a fixed interface such as "pppoe-wan1" in my case.
Then, I will config the sddns.sh script to bind the ip of this fixed interface to the dns name always.
Is there existing this way ?
Thanks!