All Clients Showing the Same IP Address
Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech
Forum rules
Please use the [oconf] BB tag for openvpn Configurations. See viewtopic.php?f=30&t=21589 for an example.
Please use the [oconf] BB tag for openvpn Configurations. See viewtopic.php?f=30&t=21589 for an example.
- ynagy
- OpenVpn Newbie
- Posts: 9
- Joined: Mon Apr 04, 2016 8:33 pm
- Location: Toronto, ON Canada
All Clients Showing the Same IP Address
I just wondering if someone can help and I apologies if I posted on the wrong place.
I have OpenVPN working great for the last number of months with no single issue. I have configured the OpenVPN server as a routed configuration connected to 3 branches for varies usage and IP phones. It seems everything working fine but the issue now on the PBX all connection showing from the same IP address which is the OpenVPN server.
The question, how can I show the branches IP addresses instead of the OpenVPN server?
I have OpenVPN working great for the last number of months with no single issue. I have configured the OpenVPN server as a routed configuration connected to 3 branches for varies usage and IP phones. It seems everything working fine but the issue now on the PBX all connection showing from the same IP address which is the OpenVPN server.
The question, how can I show the branches IP addresses instead of the OpenVPN server?
- ynagy
- OpenVpn Newbie
- Posts: 9
- Joined: Mon Apr 04, 2016 8:33 pm
- Location: Toronto, ON Canada
Re: All Clients Showing the Same IP Address
Shall I change the configuration from routed to bridging configuration?
- Traffic
- OpenVPN Protagonist
- Posts: 4066
- Joined: Sat Aug 09, 2014 11:24 am
Re: All Clients Showing the Same IP Address
Please see the Forum rules (top of page)
- ynagy
- OpenVpn Newbie
- Posts: 9
- Joined: Mon Apr 04, 2016 8:33 pm
- Location: Toronto, ON Canada
Re: All Clients Showing the Same IP Address
Sorry I forget to include server and client configuration with the initial post.
Server configuration:
Client Configuration:
Server configuration:
Code: Select all
local 172.16.71.202
port 1194
proto udp
dev tun
ca /etc/openvpn/easy-rsa/keys/ca.crt
cert /etc/openvpn/easy-rsa/keys/OpenVPN-Server.crt
key /etc/openvpn/easy-rsa/keys/OpenVPN-Server.key
dh /etc/openvpn/easy-rsa/keys/dh2048.pem
server 172.16.171.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push "route 172.16.71.0 255.255.255.0"
push "route 172.16.171.0 255.255.255.0"
push "route 172.16.172.0 255.255.255.0"
push "redirect-gateway def1 bypass-dhcp"
push "dhcp-option DNS xxx.xxx.xxx.xxx"
push "dhcp-option DNS xxx.xxx.xxx.xxx"
push "dhcp-option DNS 8.8.8.8"
push "dhcp-option DNS 8.8.4.4"
client-to-client
keepalive 10 120
tls-auth /etc/openvpn/easy-rsa/keys/ta.key 0
cipher AES-128-CBC
comp-lzo
max-clients 10
user nobody
group nogroup
persist-key
persist-tun
status /var/log/openvpn/serverUDP1194-status.log 20
log-append /var/log/openvpn/serverUDP1194.log
verb 1
push "explicit-exit-notify 3"
Code: Select all
client
dev tun
proto udp
remote openvpn.mydomain.com 1194
resolv-retry infinite
nobind
user nobody
group nogroup
persist-key
persist-tun
<ca>
-----BEGIN CERTIFICATE-----
-----END CERTIFICATE-----
</ca>
<cert>
-----BEGIN CERTIFICATE-----
-----END CERTIFICATE-----
</cert>
<key>
-----BEGIN PRIVATE KEY-----
-----END PRIVATE KEY-----
</key>
<tls-auth>
-----BEGIN OpenVPN Static key V1-----
-----END OpenVPN Static key V1-----
</tls-auth>
ns-cert-type server
key-direction 1
cipher AES-128-CBC
comp-lzo
verb 1
- Traffic
- OpenVPN Protagonist
- Posts: 4066
- Joined: Sat Aug 09, 2014 11:24 am
Re: All Clients Showing the Same IP Address
Have you enabled iptables NAT on your server ?
- ynagy
- OpenVpn Newbie
- Posts: 9
- Joined: Mon Apr 04, 2016 8:33 pm
- Location: Toronto, ON Canada
Re: All Clients Showing the Same IP Address
Yes, I have enabled the net.ipv4.ip_forward=1 on /etc/sysctl.conf
I also created a script with the following:
to run in /etc/network/interfaces
Is this what do you you mean? or you mean something different? Am I missing anything?
I also created a script with the following:
Code: Select all
#!/bin/sh
iptables -t nat -A POSTROUTING -s 172.16.171.0/24 -o eth0 -j SNAT --to-source 172.16.71.202
iptables -t nat -A POSTROUTING -s 172.16.172.0/24 -o eth0 -j SNAT --to-source 172.16.71.202
Code: Select all
auto eth0
allow-hotplug eth0
iface eth0 inet static
pre-up /etc/firewall-openvpn-rules.sh
address 172.16.71.202
netmask 255.255.255.0
network 172.16.71.0
broadcast 172.16.71.255
gateway 172.16.71.1
- Traffic
- OpenVPN Protagonist
- Posts: 4066
- Joined: Sat Aug 09, 2014 11:24 am
Re: All Clients Showing the Same IP Address
This is NAT (Read about it):
You must configure a fully routed network .. This is the openvpn HOWTO:
HOWTO: Expanding the scope of the VPN to include additional machines
It is also the reason all your clients appear to be the server.ynagy wrote:Code: Select all
#!/bin/sh iptables -t nat -A POSTROUTING -s 172.16.171.0/24 -o eth0 -j SNAT --to-source 172.16.71.202 iptables -t nat -A POSTROUTING -s 172.16.172.0/24 -o eth0 -j SNAT --to-source 172.16.71.202
You must configure a fully routed network .. This is the openvpn HOWTO:
HOWTO: Expanding the scope of the VPN to include additional machines
- ynagy
- OpenVpn Newbie
- Posts: 9
- Joined: Mon Apr 04, 2016 8:33 pm
- Location: Toronto, ON Canada
Re: All Clients Showing the Same IP Address
Thank you so much for the quick reply but I am not that technical person ... I am covering additional role added to me since they fired the network guy.
Would you mind to explain a bit more in what I should do ...
Would you mind to explain a bit more in what I should do ...
- Traffic
- OpenVPN Protagonist
- Posts: 4066
- Joined: Sat Aug 09, 2014 11:24 am
Re: All Clients Showing the Same IP Address
If you give me remote access I can do it for you .. for a fee.
- ynagy
- OpenVpn Newbie
- Posts: 9
- Joined: Mon Apr 04, 2016 8:33 pm
- Location: Toronto, ON Canada
Re: All Clients Showing the Same IP Address
How much would you charge? and how long do you need?
- Traffic
- OpenVPN Protagonist
- Posts: 4066
- Joined: Sat Aug 09, 2014 11:24 am
Re: All Clients Showing the Same IP Address
See my profile
- ynagy
- OpenVpn Newbie
- Posts: 9
- Joined: Mon Apr 04, 2016 8:33 pm
- Location: Toronto, ON Canada
Re: All Clients Showing the Same IP Address
I have applied the changes as per your recommendation with no luck ... All clients still showing the server "OpenVPN" IP address. Would could be other suggestion(s)?
-
- OpenVpn Newbie
- Posts: 1
- Joined: Tue May 12, 2020 8:20 pm
-
- OpenVPN Protagonist
- Posts: 11137
- Joined: Fri Jun 03, 2016 1:17 pm