You are not logged in.

#1 2010-12-15 06:15:05

looshfoo
Member
Registered: 2010-12-15
Posts: 5

IPv4 routes keep being readded (SOLVED)

i have static routing for everything i need as far as ipv4 goes, and want to delete the default route for ipv4. i have done so already by doing..

ip route del default via 172.20.1.1 dev eth0

but every once and a while i check my routes again and it's back..



[root@helloworld ~]# ip route show
209.51.161.58 via 172.20.1.1 dev eth0
172.20.1.0/24 dev eth0  proto kernel  scope link  src 172.20.1.74  metric 202
default via 172.20.1.1 dev eth0  metric 202


whats up with this? how can i prevent it? i mean i could always just setup a cronjob to attempt to delete it every 5 minutes or something, but thats kind of a dirty way of doing it and i'd like to prevent it from coming back (or at LEAST stay persistant until the next reboot, then i can apply it again)

thinking about it, could it be the dhcp lease on the local router going up and it running a dhcp request and getting the route again?

Last edited by looshfoo (2010-12-16 07:22:47)

Offline

#2 2010-12-15 07:35:10

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,237
Website

Re: IPv4 routes keep being readded (SOLVED)

looshfoo wrote:

thinking about it, could it be the dhcp lease on the local router going up and it running a dhcp request and getting the route again?

Yes.
Your lease is only valid for X minutes/hours, after that it has to be renewed, which will recreate the def route. There's probably a config option in your dhcp client to ignore the def route.

Offline

#3 2010-12-15 09:55:54

looshfoo
Member
Registered: 2010-12-15
Posts: 5

Re: IPv4 routes keep being readded (SOLVED)

ah, ok. i run my leases kinda short. i wasn't sure if it would readd the route for sure or not though. thanks for the clarification.

for the record i'm using dhcpcd and i think the -G switch is my solution. not sure, just did a quick glance at the man page before heading off to bed.

Offline

#4 2010-12-16 07:22:11

looshfoo
Member
Registered: 2010-12-15
Posts: 5

Re: IPv4 routes keep being readded (SOLVED)

in:

/etc/conf.d/dhcpcd

adding "-G <gateway>" solved it

DHCPCD_ARGS="-q -G 172.20.1.1"

and a reboot..

[01:16:10] jason@helloworld:[~]: ip route show
209.51.161.58 via 172.20.1.1 dev eth0
172.20.1.0/24 dev eth0  proto kernel  scope link  src 172.20.1.74  metric 202
[01:16:13] jason@helloworld:[~]:

thanks for confirming my suspicions, solved!

Offline

#5 2010-12-16 10:02:13

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,237
Website

Re: IPv4 routes keep being readded (SOLVED)

You're welcome, and welcome to the forums btw smile

Offline

Board footer

Powered by FluxBB