nito
I have configured Openvpn server 2.2 on centos 5.8. Windows clients clients with Widows openVPN GUI can connect to Openvpn BOX.
Few weeks ago I configured another Openvpn server in client mode on centos 5.8 which also connects to server, it gets an ip from server, but I discovered that this client can not ping the server. Server can ping the client normaly. Both OpenVPN servers are not default getaways for their subnet and they both have one yust one nic.
Server side subnet:
192.168.1.0/24
Server IP on the local subnet: 192.168.1.45
Default getaway for the subnet: 192.168.1.1
VPN ip for the server 10.8.0.1
Client side subnet:
10.77.55.0/24
Client IP on the local subnet: 10.77.55.19
Default gateway for the subnet 10.77.55.1
VPN client 10.8.0.2
Problem:
ping from server: ping 10.8.0.2 works OK
ping from client: ping 10.8.0.1 is not working
Any idea how to solve this problem. I realy dont know what to do. I have googled a lot but can not find any solution for this problem.
# SERVER:CONF
port 1194
proto udp
dev tun
ca ca.crt
cert server.crt
key server.key
dh dh2048.pem
server 10.8.0.0 255.255.255.0
ifconfig 10.8.0.1 10.8.0.2
ifconfig-pool-persist ipp.txt
push "redirect-gateway def1 bypass-dhcp"
keepalive 10 120
tls-server
tls-auth ta.key 0
comp-lzo
user nobody
group nobody
persist-key
persist-tun
status openvpn-status.log
log-append openvpn.log
verb 3
fragment 1400
script-security 2
chroot ../chroot/openvpn
client-config-dir clients
crl-verify crl.pem
#CLIENT.CONF
remote XX5.XX.76.22 1194 udp
client
proto udp
dev tun
nobind
mssfix 1450
ca /etc/openvpn/vpn-1/ca.crt
cert /etc/openvpn/vpn-1/vpncrt
key /etc/openvpn/vpn-11/vpnserverclient1.key
tls-client
tls-auth /etc/openvpn/vpn-1/ta.key 1
ifconfig 10.8.0.2 10.8.0.3
persist-key
persist-tun
keepalive 10 60
script-security 2
comp-lzo
user nobody
group nobody
fragment 1400
verb 3
log-append openvpn.log
status openvpn-status.log
Iptables on client:
iptables -A INPUT -i tun0 -j ACCEPT
iptables -A FORWARD -i tun0 -j ACCEPT
iptables -A INPUT -i tap0 -j ACCEPT
iptables -A FORWARD -i tap0 -j ACCEPT
iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -j SNAT --to 10.77.55.19
Iptables on server:
iptables -A INPUT -i tun0 -j ACCEPT
iptables -A FORWARD -i tun0 -j ACCEPT
iptables -A INPUT -i tap0 -j ACCEPT
iptables -A FORWARD -i tap0 -j ACCEPT
iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -j SNAT --to 192.168.1.45