Openvpn overrides default routing after connection

Need help configuring your VPN? Just post here and you'll get that help.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Forum rules
Please use the [oconf] BB tag for openvpn Configurations. See viewtopic.php?f=30&t=21589 for an example.
Post Reply
zamek42
OpenVpn Newbie
Posts: 2
Joined: Tue Aug 30, 2022 7:51 am

Openvpn overrides default routing after connection

Post by zamek42 » Wed Mar 08, 2023 12:12 pm

Hi All,
I have a Debian op.sys, with OpenVPN 2.5.1. After I connect to server it works well, but one minutes later it inserts an extra default routing.
Here is my routing before start:

Code: Select all

default         sagemcom        0.0.0.0         UG    600    0        0 wlp3s0
link-local      0.0.0.0         255.255.0.0     U     1000   0        0 docker0
172.17.0.0      0.0.0.0         255.255.0.0     U     0      0        0 docker0
192.168.1.0     0.0.0.0         255.255.255.0   U     600    0        0 wlp3s0

and after start:

Code: Select all

default         sagemcom        0.0.0.0         UG    600    0        0 wlp3s0
10.2.1.79       10.160.240.1    255.255.255.255 UGH   0      0        0 tap0
10.2.2.6        10.160.240.1    255.255.255.255 UGH   0      0        0 tap0
10.159.0.12     10.160.240.1    255.255.255.255 UGH   0      0        0 tap0
10.159.0.16     10.160.240.1    255.255.255.255 UGH   0      0        0 tap0
10.160.240.0    0.0.0.0         255.255.240.0   U     0      0        0 tap0
link-local      0.0.0.0         255.255.0.0     U     1000   0        0 docker0
172.17.0.0      0.0.0.0         255.255.0.0     U     0      0        0 docker0
192.168.0.25    10.160.240.1    255.255.255.255 UGH   0      0        0 tap0
192.168.0.92    10.160.240.1    255.255.255.255 UGH   0      0        0 tap0
192.168.0.151   10.160.240.1    255.255.255.255 UGH   0      0        0 tap0
192.168.0.158   10.160.240.1    255.255.255.255 UGH   0      0        0 tap0
192.168.0.182   10.160.240.1    255.255.255.255 UGH   0      0        0 tap0
192.168.0.213   10.160.240.1    255.255.255.255 UGH   0      0        0 tap0
192.168.1.0     0.0.0.0         255.255.255.0   U     600    0        0 wlp3s0
192.168.2.0     10.160.240.1    255.255.255.0   UG    0      0        0 tap0
192.168.2.7     10.160.240.1    255.255.255.255 UGH   0      0        0 tap0
192.168.3.0     10.160.240.1    255.255.255.0   UG    0      0        0 tap0
and after 1 minutes:

Code: Select all

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         0.0.0.0         255.255.255.255 UH    0      0        0 tap0
default         0.0.0.0         0.0.0.0         U     0      0        0 tap0
default         sagemcom        0.0.0.0         UG    600    0        0 wlp3s0
10.2.1.79       10.160.240.1    255.255.255.255 UGH   0      0        0 tap0
10.2.2.6        10.160.240.1    255.255.255.255 UGH   0      0        0 tap0
10.159.0.12     10.160.240.1    255.255.255.255 UGH   0      0        0 tap0
10.159.0.16     10.160.240.1    255.255.255.255 UGH   0      0        0 tap0
10.160.240.0    0.0.0.0         255.255.240.0   U     0      0        0 tap0
link-local      0.0.0.0         255.255.0.0     U     0      0        0 tap0
link-local      0.0.0.0         255.255.0.0     U     1000   0        0 docker0
172.17.0.0      0.0.0.0         255.255.0.0     U     0      0        0 docker0
192.168.0.25    10.160.240.1    255.255.255.255 UGH   0      0        0 tap0
192.168.0.92    10.160.240.1    255.255.255.255 UGH   0      0        0 tap0
192.168.0.151   10.160.240.1    255.255.255.255 UGH   0      0        0 tap0
192.168.0.158   10.160.240.1    255.255.255.255 UGH   0      0        0 tap0
192.168.0.182   10.160.240.1    255.255.255.255 UGH   0      0        0 tap0
192.168.0.213   10.160.240.1    255.255.255.255 UGH   0      0        0 tap0
192.168.1.0     0.0.0.0         255.255.255.0   U     600    0        0 wlp3s0
192.168.2.0     10.160.240.1    255.255.255.0   UG    0      0        0 tap0
192.168.2.7     10.160.240.1    255.255.255.255 UGH   0      0        0 tap0
192.168.3.0     10.160.240.1    255.255.255.0   UG    0      0        0 tap0
this is the problem:

Code: Select all

0.0.0.0         0.0.0.0         255.255.255.255 UH    0      0        0 tap0
default         0.0.0.0         0.0.0.0         U     0      0        0 tap0
My opnvpn file is:

Code: Select all

ca vpn_ca.crt
remote-cert-tls server
client
nobind
keepalive 3 30
dev tap
proto tcp-client
remote-random
remote xxxxxxxxxxxxxxx 1203
remote xxxxxxxxxxxxxxx 1204
remote xxxxxxxxxxxxxxx 1205
remote xxxxxxxxxxxxxxx 1206
remote xxxxxxxxxxxxxxx 1207
remote xxxxxxxxxxxxxxx 1208
remote xxxxxxxxxxxxxxx 1209
remote xxxxxxxxxxxxxxx 1210
auth-user-pass ./login.conf
verb 4
cipher AES-256-CBC
How can I disable adding default route? Unfortunately I cannot see and modify server side.

Post Reply