Start Openvpn Instance/Interface with my assigned internal IP 10.x.x.x

good day mate,

I have 2 OpenVPN tunnels start up at boot.
The IP address are assigned randomly ".7" ".11" as see below.
Is there a way to assign a static IP when the interface/tunnel start?
I've tried setting in Interface or opvn, but seems none work.
can't it be done in ovpn? or need to setup DHCP?

would you please advise?

tun1 Link encap:UNSPEC HWaddr
inet addr:10.8.8.7 P-t-P:10.8.8.7 Mask:255.255.255.0
tun2 Link encap:UNSPEC HWaddr
inet addr:10.8.8.11 P-t-P:10.8.8.11 Mask:255.255.255.0

one of my ovpn file:


log /var/log/vpn.log
ifconfig-push 10.8.8.2 10.8.8.1  <--not work, tried to assign my self to .2 instead
# ifconfig 10.8.8.2 10.8.8.1   <--not work, tried to assign my self to .2 instead

#pull-filter ignore "redirect-gateway"
#route 0.0.0.0 0.0.0.0 vpn_gateway 30
#route-metric 30
#route-nopull

OpenVPN server can be configured to assign static IPs to specific clients, see " Configuring client-specific rules and access policies" here: https://openvpn.net/community-resources/how-to/#policy

2 Likes

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.