Ubuntu v24 Route all traffic via vpn

Post your questions about SoftEther VPN software here. Please answer questions if you can afford.
Post Reply
tutti
Posts: 2
Joined: Wed May 06, 2026 10:10 am

Ubuntu v24 Route all traffic via vpn

Post by tutti » Wed May 06, 2026 10:22 am

Hello,

I tried to use softether on my linux ubuntu < noob on linux still learning.

I can connect via vpncmd no problem

I changed /proc/sys/net/ipv4/ip_forward to 1

dhclient vpn_vpn_se

Code: Select all

Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         192.168.10.1    0.0.0.0         UG        0 0          0 wlp1s0
10.211.0.0      0.0.0.0         255.255.0.0     U         0 0          0 vpn_vpn_se
192.168.10.0    0.0.0.0         255.255.255.0   U         0 0          0 wlp1s0
Routing is only via local ip

after sudo ip route add 10.211.0.0 via 192.168.0.1 and or 10.211.1.6 via 192.168.10.1 vpn ip
and ip route del default via 192.168.10.1

Code: Select all

Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
10.211.0.0      192.168.10.1    255.255.0.0     UG        0 0          0 wlp1s0
10.211.1.6      192.168.10.1    255.255.255.255 UGH       0 0          0 wlp1s0
192.168.10.0    0.0.0.0         255.255.255.0   U         0 0          0 wlp1s0
no internet access and vpn get disconnected after I remove the default 192.168.10.1 gateway

solo
Posts: 1879
Joined: Sun Feb 14, 2021 10:31 am

Re: Ubuntu v24 Route all traffic via vpn

Post by solo » Wed May 06, 2026 10:31 am


tutti
Posts: 2
Joined: Wed May 06, 2026 10:10 am

Re: Ubuntu v24 Route all traffic via vpn

Post by tutti » Wed May 06, 2026 11:21 am

solo wrote:
Wed May 06, 2026 10:31 am
viewtopic.php?f=7&t=68335&p=99223#p99223
connect and note the server's address
- ip route add [server address] via [default GW]
- ip route del default
- dhclient vpn_vpn

so are we talking "server adress" the ip from the VPN tunnel or the IP I got from the VPN tunnel.

Code: Select all

Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
42.117.xxx.xxx   192.168.10.1    255.255.255.255 UGH       0 0          0 wlp1s0
192.168.10.0    0.0.0.0         255.255.255.0   U         0 0          0 wlp1s0

anyway I did post the code for the IP that the vpn server gave me and no the IP from the VPN Server both getting disconnected when I "Ip route del default"

solo
Posts: 1879
Joined: Sun Feb 14, 2021 10:31 am

Re: Ubuntu v24 Route all traffic via vpn

Post by solo » Wed May 06, 2026 11:26 am


Post Reply