1

I'm using a VPN which takes all my traffic by default. For some addresses, I'd like my computer to avoid using the VPN as it is slowing down the quality of the connection. The addresses for the service are 13.107.64.0/18, 52.112.0.0/14 and 52.120.0.0/14

I'm trying to use the route command to set this up but it doesn't like the subnet mask that's provided here:

# sudo route add 52.112.0.0/14 gw 192.168.1.1 metric 600
route: netmask 0003ffff doesn't make sense with host route

What command can I use to reroute this traffic?

joejag
  • 113
  • 2

1 Answers1

0

When adding net routes, you should specify the -net switch to the route command, as the default setting wants to deal with single-host routes, to which specifying a netmask indeed doesn't make sense. So use either this command:

sudo route add -net 52.112.0.0/14 gw 192.168.1.1 metric 600

or use the ip command (route is deprecated anyway), which can determine the route type from the netmask you give:

sudo ip route add 52.112.0.0/14 via 192.168.1.1 metric 600
Lacek
  • 7,233
  • 24
  • 28