route vpn traffic for specific destination

This forum is for general conversation and user-user networking.

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

Post Reply
shamim
OpenVpn Newbie
Posts: 1
Joined: Fri Apr 07, 2023 10:15 pm

route vpn traffic for specific destination

Post by shamim » Fri Apr 07, 2023 11:03 pm

I have a open vpn server with two interface. In one interface I used public IP which is for connect to vpn server from client side and NAT and other interface I used private IP block. I have a Cisco CUCM which I used for IP telephony service and the server is located in my LAN side with a private IP address. I want to use soft phone in my mobile or laptop from outside my campus. That's why I install a openvpn server. But the issue is when I connect to the server using vpn from outside of the campus, the call is one way (Only I can listen the voice the other end do not listen my voice). I think this is happening because of NAT. So I introduce another interface where I used the private IP (as same as CUCM IP). I add some routes but its not working. Anybody here who can help me regarding this?
My VPN server IP information:
--------------------------------------------------------------------------------------------------------------------------------
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: enp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 18:60:24:92:ce:2c brd ff:ff:ff:ff:ff:ff
inet 103.119.68.18/28 brd 103.119.68.31 scope global enp1s0
valid_lft forever preferred_lft forever

inet6 fe80::1a60:24ff:fe92:ce2c/64 scope link
valid_lft forever preferred_lft forever
3: enx00e04c534458: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 00:e0:4c:53:44:58 brd ff:ff:ff:ff:ff:ff
inet 192.168.99.60/24 brd 192.168.99.255 scope global enx00e04c534458

valid_lft forever preferred_lft forever
inet6 fe80::2e0:4cff:fe53:4458/64 scope link
valid_lft forever preferred_lft forever
4: tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN group default qlen 500
link/none
inet 172.27.110.1/25 scope global tun0
valid_lft forever preferred_lft forever
inet6 fc42:9f32:57ab:3d6f::1/112 scope global
valid_lft forever preferred_lft forever

inet6 fe80::c7c3:8524:21a0:a570/64 scope link stable-privacy
valid_lft forever preferred_lft forever
5: tun1: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN group default qlen 500
link/none
inet 172.27.110.129/25 scope global tun1
valid_lft forever preferred_lft forever
inet6 fc42:9f32:57ab:3d6f::1:1/112 scope global
valid_lft forever preferred_lft forever
inet6 fe80::bb2f:96ac:ea79:c723/64 scope link stable-privacy
valid_lft forever preferred_lft forever
6: wg0: <POINTOPOINT,NOARP,UP,LOWER_UP> mtu 1420 qdisc noqueue state UNKNOWN group default qlen 1000
link/none
inet 192.168.32.1/24 scope global wg0
valid_lft forever preferred_lft forever
inet6 fded:31ff:6cb6:7cf9::1/64 scope global
valid_lft forever preferred_lft forever
---------------------------------------------------------------------
Route information:
------------------------------------------------------------------
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 103.119.68.17 0.0.0.0 UG 0 0 0 enp1s0
103.119.68.16 0.0.0.0 255.255.255.240 U 0 0 0 enp1s0
172.27.110.0 0.0.0.0 255.255.255.128 U 0 0 0 tun0
172.27.110.128 0.0.0.0 255.255.255.128 U 0 0 0 tun1
192.168.32.0 0.0.0.0 255.255.255.0 U 0 0 0 wg0
192.168.99.0 0.0.0.0 255.255.255.0 U 0 0 0 enx00e04c534458
-----------------------------------------------------------------
/etc/openvpn/server/default-0.conf information:
-----------------------------------------------------------------
explicit-exit-notify 1
push "explicit-exit-notify 1"
push "redirect-gateway def1 ipv6"
push "route 192.168.99.0 255.255.255.0"
push "route 0.0.0.0 0.0.0.0"
push "dhcp-option DNS 9.9.9.9"
push "dhcp-option DNS 2620:fe::fe"
push "block-outside-dns"
------------------------------------------------------------------
My Server: Ubuntu 22.04
Is it possible if I want reach the destination 192.168.99.57 (CUCM IP) through 192.168.99.60 (vpn server private IP/interface) without NAT or route my vpn client traffic through 192.168.99.60 only for destination 192.168.99.57 (CUCM IP).
Someonr please help...

Post Reply