All of lore.kernel.org
 help / color / mirror / Atom feed
* ifconfig changing a routing table?
@ 2007-08-31  3:55 Dan Stromberg
  2007-08-31  4:41 ` David Miller
  2007-09-01 16:33 ` Ross Vandegrift
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Stromberg @ 2007-08-31  3:55 UTC (permalink / raw)
  To: linux-kernel


If I "ifconfig eth1 down", a rogue route disappears.

If I "ifconfig eth1 up" or "ip link set dev eth1 up", the rogue route 
comes back.

The route in question is for 10.3/16, and it's breaking some of my 
communications that should be handled by my default route.

I'm not accustomed to ifconfig changing the routing table.  Is this 
normal?

The kernel in question is 2.6.9-42.0.8.plus.c4smp.  It's a CentOSplus 
kernel.

The relevant syscalls in an strace of the above ip link command (which a 
very short strace, BTW) appear to be:

9992  socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 3
9992  ioctl(3, SIOCGIFFLAGS, {ifr_name="eth1", ifr_flags=IFF_BROADCAST|
IFF_MULTICAST}) = 0
9992  ioctl(3, SIOCSIFFLAGS, 0x7fbffff510) = 0
9992  close(3)                          = 0

The strace of ifconfig eth1 up is pretty similar, albeit with a slightly 
different 3rd argument to the SIOCSIFFLAGS.

I tracked the call chain to dev_change_flags(), but then things seemed to 
start branching out pretty fast, so I thought it might be more productive 
to ask around before continuing.

Is anyone on the list familiar with ifconfig up and/or ip link up 
changing a routing table?  How does the kernel decide what route to add 
in such a circumstance?

Thanks!



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: ifconfig changing a routing table?
  2007-08-31  3:55 ifconfig changing a routing table? Dan Stromberg
@ 2007-08-31  4:41 ` David Miller
  2007-09-01 16:33 ` Ross Vandegrift
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2007-08-31  4:41 UTC (permalink / raw)
  To: dstromberglists; +Cc: linux-kernel

From: Dan Stromberg <dstromberglists@gmail.com>
Date: Fri, 31 Aug 2007 03:55:53 +0000 (UTC)

> I'm not accustomed to ifconfig changing the routing table.  Is this 
> normal?

Every time you enable an IP address on an interface, the
kernel creates a route to that subnet which gets likewise
deleted when you remove that IP address.

This is why you can ping hosts on your local subnet even
before you add any explicit routes.

It's been like this since ancient times and it's correct.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: ifconfig changing a routing table?
  2007-08-31  3:55 ifconfig changing a routing table? Dan Stromberg
  2007-08-31  4:41 ` David Miller
@ 2007-09-01 16:33 ` Ross Vandegrift
  1 sibling, 0 replies; 3+ messages in thread
From: Ross Vandegrift @ 2007-09-01 16:33 UTC (permalink / raw)
  To: Dan Stromberg; +Cc: linux-kernel

On Fri, Aug 31, 2007 at 03:55:53AM +0000, Dan Stromberg wrote:
> Is anyone on the list familiar with ifconfig up and/or ip link up 
> changing a routing table?  How does the kernel decide what route to add 
> in such a circumstance?

By the parameteres you supplied for the interface configuration.

So, if you're getting a connected route for 10.3.0.0/16 out of dev
eth0, it's because you assigned some IP in that subnet to that device,
with a netmask of 255.255.0.0

Check that your netmask is correct.


-- 
Ross Vandegrift
ross@kallisti.us

"The good Christian should beware of mathematicians, and all those who
make empty prophecies. The danger already exists that the mathematicians
have made a covenant with the devil to darken the spirit and to confine
man in the bonds of Hell."
	--St. Augustine, De Genesi ad Litteram, Book II, xviii, 37

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-09-01 16:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-31  3:55 ifconfig changing a routing table? Dan Stromberg
2007-08-31  4:41 ` David Miller
2007-09-01 16:33 ` Ross Vandegrift

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.