0

I have an OpenVPN network and I need to assign multiple ip addresses to one client (like 10.8.0.10 and 10.8.0.12) But i could not figured out.

is it possible to do it?

Firstly, I tried to create multiple VPN client for same machine and i assigned two addresses but I cannot ping to second ip address.

My Server conf:

port 1194
proto udp
dev tun
ca ca.crt
cert server.crt
key server.key
dh dh.pem
tls-auth ta.key 0
crl-verify /etc/openvpn/crl.pem
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
keepalive 2 10
cipher AES-256-CBC
persist-key
persist-tun
status /var/log/openvpn/openvpn-status.log
log /var/log/openvpn/openvpn.log
log-append /var/log/openvpn/openvpn.log
verb 4
client-config-dir /etc/openvpn/ccd
# cat ccd/c1
ifconfig-push 10.8.0.10 255.255.255.0

# cat ccd/c2
ifconfig-push 10.8.0.10 255.255.255.0

in my client server config files

# cat c1.conf
client
dev tun0
proto udp
remote my-vpn-server 1194
resolv-retry infinite
nobind
persist-key
persist-tun
remote-cert-tls server
cipher AES-256-CBC
verb 3
keepalive 2 10
user nobody
group nogroup
key-direction 1



# cat c2.conf
client
dev tun1
proto udp
remote my-vpn-server 1194
resolv-retry infinite
nobind
persist-key
persist-tun
remote-cert-tls server
cipher AES-256-CBC
verb 3
keepalive 2 10
user nobody
group nogroup
key-direction 1

ip a output

5: tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN group default qlen 500
    link/none
    inet 10.8.0.10 peer 255.255.255.0/32 scope global tun0
       valid_lft forever preferred_lft forever
    inet6 fe80::cdbc:d6b3:964d:77a6/64 scope link stable-privacy
       valid_lft forever preferred_lft forever
6: tun1: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN group default qlen 500
    link/none
    inet 10.8.0.12 peer 255.255.255.0/32 scope global tun1
       valid_lft forever preferred_lft forever
    inet6 fe80::683d:f656:71b0:903a/64 scope link stable-privacy
       valid_lft forever preferred_lft forever
5
  • Why? What do you want to achieve? Is routing a network an alternative?
    – vidarlo
    Commented May 30 at 11:10
  • I don't understand what do you mean. But my logic is need that.
    – enesgur
    Commented May 30 at 11:46
  • You can route a different network over the connection. Is that an alternative? And why do you need multiple IP's? To me this feels like X-Y problem. What is the end goal you want to achieve?
    – vidarlo
    Commented May 30 at 12:05
  • Our application need to two different ip addresses for their logic so I needed to set up two machines. But right now we don't have resource enough that's why i need second ip address for the application logic. After that, when we have enough resource, i'll set up new machine with same ip addresses. @vidarlo
    – enesgur
    Commented May 30 at 12:50
  • Getting OpenVPN to comply is just the tip of iceberg. Getting the host to handle the routing is a nightmare. "But right now we don't have resource" - so use VMs or containers.
    – symcbean
    Commented May 30 at 13:08

0

You must log in to answer this question.

Browse other questions tagged .