1. Subscriptions
  2. Services
  3. Hardware
  4. Support

ClearFoundation

Forums
Welcome, Guest
Cant Access Client Network From OpenVPN Server
(1 viewing) 1 Guest
Go to bottomPage: 1
TOPIC: Cant Access Client Network From OpenVPN Server
#37401
Cant Access Client Network From OpenVPN Server 3 Months, 2 Weeks ago  
hii all

i just trying to setup a site to site VPN with OpenVPN
im using ClearOS as OpenVPN Server and i user Mikrotik RouterOS as Client and router
i setup my clearos as standalone-nofirewall server

the topology :
[img]


the Openvpn connection handshake is successfully establish
it need some modification in /etc/openvpn/client.conf

1. removing comp-lzo, coz mikrotik not support it
2. change proto from udp to tcp, coz mirkotik not support udp it too

and adding this iptables

iptables -A FORWARD -i tun+ -j ACCEPT
iptables -A OUTPUT -o tun+ -j ACCEPT
iptables -A INPUT -i tun+ -j ACCEPT
iptables -t nat -A POSTROUTING -s 172.16.0.0/24 -j MASQUERADE


from mikrotik and client network, i can access remote network without any problem
but when i try to access client network it not working
from 172.16.99.10 i cant ping to 192.168.88.1
but i still can ping to openvpn server and client virtual ip 172.16.0.1 and 172.16.0.10
from ClearOS server

i still stunk with this case and still trying to googling around to find the answer
fyi here is my configuration

a have another question
why everytime i start the openvpn servis
automaticaly tun0 was define ip 172.16.0.1
but in route only it define ip 172.16.0.2


ClearOS-client.conf
Code:


port 1194
proto tcp
dev tun
ca /etc/ssl/ca-cert.pem
cert /etc/ssl/sys-0-cert.pem
key /etc/ssl/private/sys-0-key.pem
dh /etc/ssl/dh1024.pem
auth-nocache
server 172.16.0.0 255.255.255.0
keepalive 10 120
comp-lzo
user nobody
group nobody
persist-key
persist-tun
ifconfig-pool-persist /var/lib/openvpn/ipp.txt
status /var/lib/openvpn/openvpn-status.log
verb 3
plugin /usr/share/openvpn/plugin/lib/openvpn-auth-ldap.so /etc/openvpn/auth-ldap
push "dhcp-option DNS 172.16.99.3"
push "dhcp-option WINS 172.16.99.3"
push "dhcp-option DOMAIN terminix.co.id"
push "route 172.16.99.0 255.255.255.0"



ClearOS-iptables
Code:


iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination
ACCEPT     all  --  anywhere             anywhere

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination
ACCEPT     all  --  anywhere             anywhere

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
ACCEPT     all  --  anywhere             anywhere

Chain drop-lan (0 references)
target     prot opt source               destination
DROP       all  --  anywhere             anywhere



ClearOS-Route
Code:


Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
172.16.0.2      0.0.0.0         255.255.255.255 UH    0      0        0 tun0
172.16.0.0      172.16.0.2      255.255.255.0   UG    0      0        0 tun0
172.16.99.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
0.0.0.0         172.16.99.1     0.0.0.0         UG    0      0        0 eth0



ClearOS-ipp-txt
Code:


router01,172.16.0.8



ClearOS-ifconfig tun0
Code:


ifconfig tun0
tun0      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
          inet addr:172.16.0.1  P-t-P:172.16.0.2  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
          RX packets:575 errors:0 dropped:0 overruns:0 frame:0
          TX packets:685 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:100
          RX bytes:54007 (52.7 KiB)  TX bytes:82286 (80.3 KiB)



Mikrotik OpenVPN client Configuration

-- IPAddress --
Code:


# ADDRESS NETWORK INTERFACE
0 192.168.88.1/24 192.168.88.0 bridge-local
1 D 182.4.252.25/32 10.112.112.130 ppp-out1 -- Dial Up Modem
2 D 172.16.0.10/32 172.16.0.1 ovpn-out2 -- interface OpenVpn client



-- IP Route --
Code:


# DST-ADDRESS PREF-SRC GATEWAY DISTANCE
0 ADS 0.0.0.0/0 10.112.112.130 1
1 ADC 10.112.112.130/32 182.4.252.25 ppp-out1 0
2 ADC 172.16.0.1/32 172.16.0.10 ovpn-out2 0
3 A S 172.16.99.0/24 ovpn-out2 1
4 ADC 192.168.88.0/24 192.168.88.1 bridge-local 0

zhia c
Fresh Boarder
Posts: 12
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#37406
Re: Cant Access Client Network From OpenVPN Server 3 Months, 2 Weeks ago  
ClearOS does not know where the 192.168.88.0/24 subnet is. You will need to add a route for it to route the whole subnet via your VPN. Try something like:
Code:

ip route add 192.168.88.0/24 dev tun0

There is also the "route" command which can achieve the same sort of thing.
Nick Howitt
Platinum Boarder
Posts: 2823
graphgraph
User Online Now Click here to see the profile of this user
The administrator has disabled public write access.
 
#37442
Re: Cant Access Client Network From OpenVPN Server 3 Months, 2 Weeks ago  
i already try it

i change my routing table like this one :
but still nothing change..


Code:


[root@pdc ~]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
172.16.0.0      172.16.0.1      255.255.255.255 UGH   0      0        0 tun0
172.16.0.10     172.16.0.1      255.255.255.255 UGH   0      0        0 tun0
172.16.99.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
192.168.88.0    172.16.0.1      255.255.255.0   UG    0      0        0 tun0
0.0.0.0         172.16.99.1     0.0.0.0         UG    0      0        0 eth0
[root@pdc ~]# ping 192.168.88.1
PING 192.168.88.1 (192.168.88.1) 56(84) bytes of data.

--- 192.168.88.1 ping statistics ---
7 packets transmitted, 0 received, 100% packet loss, time 6018ms

zhia c
Fresh Boarder
Posts: 12
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#37452
Re: Cant Access Client Network From OpenVPN Server 3 Months, 2 Weeks ago  
Which command did you use to add the route? I also wonder if you need to set up the route to go via 172.16.0.10 rather than tun0.
Nick Howitt
Platinum Boarder
Posts: 2823
graphgraph
User Online Now Click here to see the profile of this user
The administrator has disabled public write access.
 
#37472
Re:Cant Access Client Network From OpenVPN Server 3 Months, 2 Weeks ago  
hi nick

i think i got the problem here..

im not define branch office network route on client.conf

seems that the routing table not working for tun0 interface
if it not define on the server configuration file
zhia c
Fresh Boarder
Posts: 12
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
Go to topPage: 1
  get the latest posts directly to your desktop