Page 1 of 1

How to configure reserved ip

Posted: Mon Feb 11, 2019 10:58 am
by rinagute
Hi, I have followed https://www.digitalocean.com/community/tutorials/how-to-set-up-an-openvpn-server-on-ubuntu-18-04 this tutorial[/url] and it's working fine.

But now I added a reserved ip and want it to be used.

The file /etc/netplan/10-ens.yaml is this:

10-ens.yaml

network:
version: 2
renderer: networkd
ethernets:
ens3:
dhcp4: no
addresses: [DEFAULT_IPV4_IP/23,RESERVED_IPV4_IP/32,'IPV6_IP/64']
gateway4: IPV4_GATEWAY
nameservers:
addresses: [108.61.10.10]
routes:
- to: 169.254.0.0/16
via: IPV4_GATEWAY
metric: 100


When I do that, the RESERVED_IPV4_IP is reachable but OpenVPN still uses the DEFAULT_IPV4_IP.
I would like the users connect through the default DEFAULT_IPV4_IP and masquerade those connections using the RESERVED_IPV4_IP.

Is that possible?

Re: How to configure reserved ip

Posted: Mon Feb 11, 2019 12:55 pm
by rinagute
I thought it was not needed. My server.conf:

server.conf

local DEFAULT_IPV4_IP
port 1194
proto udp
dev tun
ca ca.crt
cert server.crt
key server.key
dh dh.pem
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist /var/log/openvpn/ipp.txt
push "redirect-gateway def1 bypass-dhcp"
push "dhcp-option DNS 208.67.222.222"
push "dhcp-option DNS 208.67.220.220"
keepalive 10 120
tls-auth ta.key 0 key-direction 0
cipher AES-256-CBC
auth SHA256
user nobody
group nogroup
persist-key
persist-tun
status /var/log/openvpn/openvpn-status.log
verb 3
explicit-exit-notify 1