Date: Tue, 14 Jan 2003 23:01:42 -0800 From: Justin Walker <justin@mac.com> To: freebsd-hackers@FreeBSD.ORG Subject: Re: adding some new IPs from a different subnet - errors Message-ID: <33B56C40-2857-11D7-B494-00306544D642@mac.com> In-Reply-To: <20030114224329.Y39623-100000@mail.econolodgetulsa.com>
next in thread | previous in thread | raw e-mail | index | archive | help
All of this depends on how 'ifconfig' and the kernel cooperate in interpreting address/mask pairs. Normally, I would expect that you do the following when adding 'aliases': if the alias IP address is on the same subnet as an existing address for this interface, use the netmask 255.255.255.255; in your case, 10.10.10.1 exists, and you are adding .2 and .3 if the alias address is for a *new* subnet, you need to use a "real" netmask (you will have to figure out exactly what that should be; maybe 255.255.255.0); in your case, you are adding 192.168.0.2, which is new, so you *don't* use 255.255.255.255 as a netmask The netmask 255.255.255.255 is kind of funky, but in essence it is taken as a "point-to-point" mask; for addresses which lie on an existing subnet, this mask tells the kernel that "packets going to 10.10.10.2 go right to wherever 10.10.10.1 goes" [I'm finessing a few details]. When you use this netmask on a non-point-to-point link, like an ethernet, and there's nothing pre-existing to point to, the kernel gets confused (there is no existing subnet that matches "192.168.0.1/255.255.255.255", hence the error message). The fix is to add that "alias" address with a "proper" netmask. Since you are using it, I assume there's a related subnet running on the "cable" the device is connected to, so that should tell you what to use. Hope that helps. Regards, Justin On Tuesday, Jan 14, 2003, at 22:45 US/Pacific, Josh Brooks wrote: > > Hi, > > I have a rc.conf that looks like: > > defaultrouter="10.10.10.1" > ifconfig_fxp0="inet 10.10.10.2 netmask 255.255.255.0" > ifconfig_fxp0_alias0="inet 10.10.10.3 netmask 255.255.255.255" > > Ok, easy enough - one interface, one default router, and two IPs on > that > subnet. > > BUT - as it happens, 10.10.10.1 is _also_ the default router for > 192.168.0.0/24 ... it has the IP 192.168.0.1, but it also has the IP of > 10.10.10.1 - it is the same default router, but with a few different > subnets on it. > > So, I went and added one of the 192 addresses to my system: > > defaultrouter="10.10.10.1" > ifconfig_fxp0="inet 10.10.10.2 netmask 255.255.255.0" > ifconfig_fxp0_alias0="inet 10.10.10.3 netmask 255.255.255.255" > ifconfig_fxp0_alias1="inet 192.168.0.2 netmask 255.255.255.255" > > And this works great - it works because 10.10.10.1 is also the default > router for 192.168.0.0/24. BUT, even though the network works great > and > that IP and everything else is fine, I am getting my log files full of: > > /kernel: arplookup 192.168.0.1 failed: host is not on local network > > Note that the error is about the gateway - 192.168.0.1 is the IP on the > gateway that this system uses. So, at the end of the day, everything > works great, but the system doesn't like the config and is complaining > in > the logs. > > --------- > > What is the best way to make these log errors stop occurring ? I hate > to > be a pain, but not only do I need to know what to put in rc.conf, but I > cannot reboot the system so I need to know what commands will > implement it > on the fly as well. > > BTW: I have indeed tried setting: > > sysctl -w net.link.ether.inet.log_arp_wrong_iface=0 > > and the errors still kept coming ... which makes me wonder what that > sysctl actually does ... > > many thanks! > > > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-hackers" in the body of the message > > -- Justin C. Walker, Curmudgeon-At-Large * Institute for General Semantics | If you're not confused, | You're not paying attention *--------------------------------------*-------------------------------* To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?33B56C40-2857-11D7-B494-00306544D642>