Answer the question
In order to leave comments, you need to log in
How to connect networks with OpenVPN?
Good afternoon! I'm struggling with the task of combining two networks when connecting to an OpenVPN server.
There is a machine with Ubuntu Server (local address 192.168.0.100, gateway 192.168.0.1), an OpenVPN server is running on it.
There is a remote client (local address 192.168.43.101, gateway 192.168.43.1)
There is an OpenVPN server configuration file:
port 1194
proto udp
dev tun
user openvpn
group openvpn
cd /etc/openvpn
persist-key
persist-tun
tls-server
tls-timeout 120
dh /etc/openvpn/dh.pem
ca /etc/openvpn/ca.crt
cert /etc/openvpn/vpn-server.crt
key /etc/openvpn/server.key
crl-verify /etc/openvpn/crl.pem
tls-auth /etc/openvpn/ta.key 0
server 10.15.0.0 255.255.255.0
client-config-dir /etc/openvpn/ccd
client-to-client
topology subnet
max-clients 5
push "dhcp-option DNS 10.15.0.1"
push "route 192.168.0.0 255.255.255.0"
push "route 192.168.43.0 255.255.255.0"
route 10.15.0.0 255.255.255.0
route 192.168.43.0 255.255.255.0
comp-lzo
keepalive 10 120
status /var/log/openvpn/openvpn-status.log 1
status-version 3
log-append /var/log/openvpn/openvpn-server.log
verb 3
mute 20
IPv4 таблица маршрута
===========================================================================
Активные маршруты:
Сетевой адрес Маска сети Адрес шлюза Интерфейс Метрика
0.0.0.0 0.0.0.0 192.168.43.1 192.168.43.101 55
10.15.0.0 255.255.255.0 On-link 10.15.0.12 291
10.15.0.12 255.255.255.255 On-link 10.15.0.12 291
10.15.0.255 255.255.255.255 On-link 10.15.0.12 291
127.0.0.0 255.0.0.0 On-link 127.0.0.1 331
127.0.0.1 255.255.255.255 On-link 127.0.0.1 331
127.255.255.255 255.255.255.255 On-link 127.0.0.1 331
192.168.0.0 255.255.255.0 10.15.0.1 10.15.0.12 35
192.168.43.0 255.255.255.0 On-link 192.168.43.101 311
192.168.43.101 255.255.255.255 On-link 192.168.43.101 311
192.168.43.255 255.255.255.255 On-link 192.168.43.101 311
192.168.79.0 255.255.255.0 On-link 192.168.79.1 291
192.168.79.1 255.255.255.255 On-link 192.168.79.1 291
192.168.79.255 255.255.255.255 On-link 192.168.79.1 291
192.168.182.0 255.255.255.0 On-link 192.168.182.1 291
192.168.182.1 255.255.255.255 On-link 192.168.182.1 291
192.168.182.255 255.255.255.255 On-link 192.168.182.1 291
224.0.0.0 240.0.0.0 On-link 127.0.0.1 331
224.0.0.0 240.0.0.0 On-link 192.168.43.101 311
224.0.0.0 240.0.0.0 On-link 192.168.182.1 291
224.0.0.0 240.0.0.0 On-link 10.15.0.12 291
224.0.0.0 240.0.0.0 On-link 192.168.79.1 291
255.255.255.255 255.255.255.255 On-link 127.0.0.1 331
255.255.255.255 255.255.255.255 On-link 192.168.43.101 311
255.255.255.255 255.255.255.255 On-link 192.168.182.1 291
255.255.255.255 255.255.255.255 On-link 10.15.0.12 291
255.255.255.255 255.255.255.255 On-link 192.168.79.1 291
Таблица маршутизации ядра протокола IP
Destination Gateway Genmask Flags Metric Ref Use Iface
default 192.168.0.1 0.0.0.0 UG 0 0 0 eth0
10.15.0.0 * 255.255.255.0 U 0 0 0 tun0
link-local * 255.255.0.0 U 1000 0 0 eth0
192.168.0.0 * 255.255.255.0 U 0 0 0 eth0
192.168.43.0 10.15.0.2 255.255.255.0 UG 0 0 0 tun0
Answer the question
In order to leave comments, you need to log in
where did the address 10.15.0.2 come from in the routing tablethis is the address of the tunnel interface of the client, with the directive
route 192.168.43.0 255.255.255.0you added this route to the client's network through it,
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question