Date: Tue, 23 Nov 2010 17:53:23 +0200 From: Mykola Dzham <i@levsha.me> To: "Ronald F. Guilmette" <rfg@tristatelogic.com> Cc: freebsd-net@freebsd.org Subject: Re: Configuring for 1 static and 1 DHCP interface ? Message-ID: <20101123155323.GA51348@laptop.levsha.me> In-Reply-To: <41757.1290513201@tristatelogic.com> References: <41757.1290513201@tristatelogic.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Ronald F. Guilmette wrote: > > I just recently re-jigged my main server/workstation so that instead > of just having a single interface that talks to the Internet via a > single static IP, it now has, in addition to that, one other interface > (and card) that's talking to one of those little black&blue Linksys > router thingies to which other machines on my local network are connected > (all using DHCP which is implemented in the Linksys box). > > For most stuff the default routing should be out via the original interface > (and its static IP) but when the main server/workstation wants to talk > to anything in 192.168.1.0/24, it should instead route those packets > via the second/newer interface over to the Linksys box, i.e. so that > this main machine can talk to other stuff on the local network. > > So anyway, here's what I have now in my /etc/rc.conf file: > > defaultrouter="69.62.255.254" > network_interfaces="fxp0 rl0 lo0 auto" > ifconfig_fxp0="inet 69.62.255.118 netmask 255.255.255.0" > ifconfig_rl0="DHCP" > > This is problematic for several reasons. First, as I have learned, > having any interface set to "DHCP" in the /etc/rc.conf file causes > all sorts of DHCP magic to happen at startup time, and the end result > of all that magic is that two undesirable things happen: > > 1) The /etc/resolv.conf file gets replaced with something that > causes DNS resolutions to go someplace other than where I want > them to go, and... > > 2) the default route that I attempted to set in the /etc/rc.conf > file gets clobbered and replaced by a default route obtained > from the DHCP negotiation on the second interface. You can totally disable resolv.conf changing and rote setting: put into /etc/dhclient-enter-hooks file this code: add_new_resolv_conf() { echo "doing nothing to resolv.conf" } add_new_routes() { echo "do not set routes" } -- LEFT-(UANIC|RIPE) JID: levsha@jabber.net.ua PGP fingerprint: 1BCD 7C80 2E04 7282 C944 B0E0 7E67 619E 4E72 9280
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20101123155323.GA51348>