P
P
Pom4uk2021-03-08 14:54:28
linux
Pom4uk, 2021-03-08 14:54:28

Why doesn't routing work when openvpn is enabled?

Help solve the problem, on a PC, when connected to a vpn, access to the Internet is lost

output ip r

[email protected]:~# ip r
0.0.0.0/1 via 192.168.254.1 dev tun0
default via 192.168.0.1 dev wlan0 proto static metric 600
92.104.99.62 via 192.168.0.1 dev wlan0
128.0.0.0/1 via 192.168.254.1 dev tun0
192.168.0.0/24 dev wlan0 proto kernel scope link src 192.168.0.105 metric 600
192.168.10.0/24 dev eth0 proto kernel scope link src 192.168.10.1
192.168.254.0/24 dev tun0 proto kernel scope link src 192.168.254.2


[email protected]:~# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 02:42:c6:27:b3:b1 brd ff:ff:ff:ff:ff:ff
    inet 192.168.10.1/24 brd 192.168.10.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::42:c6ff:fe27:b3b1/64 scope link
       valid_lft forever preferred_lft forever
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 12:42:c6:27:b3:b1 brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.105/24 brd 192.168.0.255 scope global dynamic wlan0
       valid_lft 6173sec preferred_lft 6173sec
    inet6 fe80::1f9c:c917:8ea8:14eb/64 scope link
       valid_lft forever preferred_lft forever
4: tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN group default qlen 100
    link/none
    inet 192.168.254.2/24 brd 192.168.254.255 scope global tun0
       valid_lft forever preferred_lft forever
    inet6 fe80::5186:752:3d24:155e/64 scope link flags 800
       valid_lft forever preferred_lft forever


when removing routes
0.0.0.0/1 via 192.168.254.1 dev tun0
128.0.0.0/1 via 192.168.254.1 dev tun0

everything works.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
R
Rsa97, 2021-03-08
@Pom4uk

https://mdex-nn.ru/page/ignorirovanie-redirect-gat...

K
ky0, 2021-03-08
@ky0

when deleting routes everything works.

Well, yes - if you do not have routing configured on the vpn server, the Internet will not work through it. If you want to go only to the internal network through vpn - do not give /1-routes.

A
Alexey Dmitriev, 2021-03-08
@SignFinder

Disable the option in the openvpn server config file that pushes the default route.
Something like
push "redirect-gateway xxx"
push "route-gateway xxx"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question