N
N
navigator6662014-01-18 20:11:15
linux
navigator666, 2014-01-18 20:11:15

Access to the local network through OpenVPN server. Routing

Good day.
There is a problem... So, we have a local network 192.168.0.0/24, it has an OpenVPN server (Ubuntu 13.10) - 192.168.0.5. openvpn config:

port 1194
proto tcp
dev tun
ca ca.crt
cert kxxxxx.crt
key kxxxxx.key  # This file should be kept secret
dh dh1024.pem
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push "route 192.168.0.0 255.255.255.0"
keepalive 10 120
comp-lzo
persist-key
persist-tun
status openvpn-status.log
verb 3

Forwarding in /proc/sys/net/ipv4/ip_forward is enabled (1). Clients connect to the server without problems and receive ip from the 10.8.0.0/24 range. At the same time, ping does not go to any of the network addresses 192.168.0.0, except for 192.168.0.5 ... it
iptables --listgives
Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     all  --  10.8.0.0/24          192.168.0.0/24

I understand that I screwed up something with routing ... help me figure it out, please.
Thanks in advance.
ifconfig:
eth0      Link encap:Ethernet  HWaddr 00:50:56:9f:6b:24  
          inet addr:192.168.0.5  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::250:56ff:fe9f:6b24/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:11943 errors:0 dropped:0 overruns:0 frame:0
          TX packets:14936 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:1742952 (1.7 MB)  TX bytes:1519545 (1.5 MB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

tun0      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  
          inet addr:10.8.0.1  P-t-P:10.8.0.2  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:100 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
navigator666, 2014-01-19
@navigator666

iptables -A FORWARD -i tun0 -s 10.8.0.0/24 -d 192.168.0.0/24 -j ACCEPT

and
resolved the issue.
After that, I created scripts to restore iptables after a reboot
. Everything works.

O
OM1, 2017-10-31
@OM1

beautiful, cho

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question