You are not logged in.

#1 2014-04-24 14:04:36

slightlycyborg
Member
Registered: 2014-04-24
Posts: 1

How do I prevent a network interface from loading a default route

I have 2 network cards. On one I connect to the internet and on the other I just connect to my LAN through a router. When I restart my computer I have to enter this command to get my internet to work: ip route del default via 207.168.1.1 dev enp8s0 metric 202
This is because enp8s0 is the card with my LAN and it is overriding the default ip route for my internet card. How do I prevent having to enter this command after every restart?

Offline

#2 2014-04-24 14:29:17

teckk
Member
Registered: 2013-02-21
Posts: 525

Re: How do I prevent a network interface from loading a default route

https://wiki.archlinux.org/index.php/Ne … figuration
https://wiki.archlinux.org/index.php/netctl
https://wiki.archlinux.org/index.php/Router:_Basic
https://wiki.archlinux.org/index.php/Network_Debugging

Have you read "For computers with multiple NICs"
Are you giving each interface it's own IP address?
What does your /etc/netctl/<network name> look like?

Offline

#3 2014-04-24 15:48:22

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: How do I prevent a network interface from loading a default route

teckk, he didn't specify which network tool he's using, so references to netctl are a little premature.

slightlycyborg, how did you configure your network?

More generally, why can't you connect to the internet via your LAN, so that you only need one interface?

Offline

#4 2014-04-24 15:54:56

branch
Member
Registered: 2014-03-16
Posts: 209

Re: How do I prevent a network interface from loading a default route

I assume this is getting set by your dhcp client? Just tell the dhcp client not to set it.
For dhcpcd this can be done with the "--nogateway" option when starting an interface specific instance, or with "nogateway" in an interface section of /etc/dhcpcd.conf.

Offline

Board footer

Powered by FluxBB