Date: Sun, 2 Dec 2007 23:14:08 +0100 From: Wolfgang Zenker <wolfgang@lyxys.ka.sub.org> To: area =?utf-8?B?ZGFtYWnihKI=?= <area.damai@gmail.com> Cc: freebsd-stable@freebsd.org Subject: Re: /etc/rc.d/netif wont add default gateway Message-ID: <20071202221408.GA52496@lyxys.ka.sub.org> In-Reply-To: <f22f48480712021242o462e6492od633d7955a247af0@mail.gmail.com> References: <f22f48480712021242o462e6492od633d7955a247af0@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Hi, * area damaiā¢ <area.damai@gmail.com> [071202 21:42]: > whenever i run /etc/rc.d/netif it will read rc.conf and add the pc IP and > netmask but it wont read the default gateway resulting lost connectivity to > internet > # -- my /etc/rc.conf : > defaultrouter="192.168.1.1" > hostname="msc.edu" > ifconfig_rl0="inet 192.168.1.9 netmask 255.255.255.0" > [..] > # -- while issuing /etc/rc.d/netif restart: > [root@msc ~]# /etc/rc.d/netif restart > Stopping network: lo0 rl0 plip0 pfsync0 pflog0. > [..] what happens is that "/etc/rc.d/netif restart" first runs "/etc/rc.d/netif stop". This stops all network interfaces. Now the kernel routing system gets notified that these interfaces are no longer available and deletes all routes that use this interfaces. After that "/etc/rc.d/netif start" runs and the interfaces become available again. Every time a network interface becomes available, the kernel adds a route to the immedialtely connected network (which is determined by interface address and netmask). So stopping an interface has the side effect of clearing ALL routes going through this nterface, while starting an interface has only the side effect of adding a route for the net that is locally connected to this interface. The kernel can not add the default route on its own again because all information about this route had been deleted ehrn the interface went down. To add non-local routes (including the default route) you could now run "/etc/rc.d/routing start" Wolfgang
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20071202221408.GA52496>