Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

When I start a VPN connection, a new default route is added on the utun0 interface:

Destination        Gateway            Flags        Refs      Use   Netif Expire
default            utun0              UCS            21        0   utun0
default            192.168.43.1       UGScI          14        0     en1

I'd like to get rid of the default/utun0 route. When using route with the -ifscope modifier, I get the following error:

$ sudo route delete -ifscope utun0 -net 0.0.0.0
route: writing to routing socket: not in table
delete net 0.0.0.0: not in table

What am I doing wrong? What's the correct syntax of the route command in order to delete the default route?

share|improve this question

closed as off-topic by Sven Jan 29 at 8:08

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions should demonstrate reasonable business information technology management practices. Questions that relate to unsupported hardware or software platforms or unmaintained environments may not be suitable for Server Fault - see the help center." – Sven
If this question can be reworded to fit the rules in the help center, please edit the question.

1  
Before doing this. Keep in mind that it is a dangerous command if you are accessing your server online ! ;) –  eVoxmusic May 16 '12 at 11:40
1  
Telling the VPN clinet not to create the route sounds a lot cleaner to me. The native pptp client can be configured like this. Are you using a different client? –  Nitz Aug 13 '14 at 8:04

5 Answers 5

Not in front of a Mac right now, off the top of my head try;

sudo route del default dev utun0
share|improve this answer
    
Sorry, but it's not working. I tried also with sudo route delete default -ifscope utun0, but still without success –  mgryszko May 16 '12 at 12:06

You can try this:

sudo route delete -net default utun0
share|improve this answer
$ sudo route delete -net 0.0.0.0 -ifp ppp0
delete net 0.0.0.0

This is documented in route(8)

share|improve this answer

I know it's late, but I'd like to know what kind of VPN you're using.

I've had this problem with Cisco Anyconnect VPN.

Not seeing the same error as you, but the command would appear to execute, but the routing table would still look the same.

I believe Cisco AnyConnect locks the routing table in some way so that it cannot be modified.

If this isn't Cisco AnyConnect, it may do something similar. I haven't found any documentation on it, but that's the conclusion I've come to from my testing.

I've found this also appears to apply on Windows.

Cheers, Aaron

share|improve this answer
    
It's Cisco. Our network topology changed, so I cannot verify the answers. –  mgryszko Nov 12 '14 at 7:12

Try route del default wlp2s0. Where wlp2s0 is the interface name. This command deletes the first default gateway on the specific interface you provide to the command.

share|improve this answer
    
Yes. Downvotes again for no reason, no explanation, just a downvote !! –  3bdalla Jan 29 at 21:09
    
Try adding an explanation of exactly what your answer does and why you believe it will solve the problem. –  fukawi2 Jan 30 at 5:52
    
You have a good point, although does not promote to be a downvote. I updated my answer. –  3bdalla Jan 30 at 11:29

Not the answer you're looking for? Browse other questions tagged or ask your own question.