From owner-freebsd-stable@FreeBSD.ORG Fri Dec 7 12:29:22 2012 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 93A9642B for ; Fri, 7 Dec 2012 12:29:22 +0000 (UTC) (envelope-from rb@gid.co.uk) Received: from mx0.gid.co.uk (mx0.gid.co.uk [194.32.164.250]) by mx1.freebsd.org (Postfix) with ESMTP id 0D6AB8FC13 for ; Fri, 7 Dec 2012 12:29:21 +0000 (UTC) Received: from rbpbp.gid.co.uk (80-46-130-69.static.dsl.as9105.com [80.46.130.69]) by mx0.gid.co.uk (8.14.2/8.14.2) with ESMTP id qB7CEARt058371; Fri, 7 Dec 2012 12:14:10 GMT (envelope-from rb@gid.co.uk) Subject: Re: Using dhclient on WAN if on a box serving DHCP to LAN if Mime-Version: 1.0 (Apple Message framework v1283) Content-Type: text/plain; charset=us-ascii From: Bob Bishop In-Reply-To: Date: Fri, 7 Dec 2012 12:14:04 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: References: To: Tom Evans X-Mailer: Apple Mail (2.1283) Cc: FreeBSD Stable X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Dec 2012 12:29:22 -0000 Hi, On 7 Dec 2012, at 11:38, Tom Evans wrote: > Hi all >=20 > Using 9.0-STABLE #1 r230946 - I found it out as I rebooted to prepare > for 9.1, but I think it should be largely irrelevant of version. >=20 > I have a freebsd router that provides all the things a soho router > should on its LAN iface - DNS, DHCP, NAT (via pf). The WAN iface > connects to a ADSL modem operating in bridge mode. >=20 > My ISP has recently forced a change on to me, in order to get service > I have to connect via DHCP, in order for them to give me my static IP. > Apparently this makes their lives a lot easier. Even knowing the IP, > netmask, broadcast and router is not enough, no service will flow > unless a DHCP request has been registered. >=20 > Relevant rc.conf, ale0 is the WAN, em0 is the LAN >=20 > ifconfig_ale0=3D"DHCP" > ifconfig_em0=3D"inet 192.168.1.1 netmask 255.255.255.0" > gateway_enable=3D"YES" >=20 > dhcpd_enable=3D"YES" > dhcpd_flags=3D"-q" > dhcpd_ifaces=3D"em0" > dhcpd_conf=3D"/usr/local/etc/dhcpd.conf" >=20 > With this configuration, the default route is over the LAN iface. This > causes the dhclient for ale0 to get a response from the local dhcpd > server, not the ISP dhcpd server. This drove me potty! Can anyone > explain why dhcpd, having been told only to listen for DHCP on em0, > responds to ale0? Could this be related to my pf rules, or is it down > to the default route being incorrect? >=20 > Changing rc.conf to this allows the network to come up correctly: >=20 > ifconfig_ale0=3D"inet xx.xx.110.172 netmask 255.255.255.0 broadcast > xx.xx.110.255 DHCP" > defaultrouter=3D"xx.xx.110.1" >=20 > This relies on me knowing that these are the values that dhclient on > the WAN iface will receive from my ISP's DHCP server. How would I > achieve this setup if this information was dynamic or otherwise > unknowable? My ISP could easily change my gateway IP, the only > guarantee I have is that my allocated IP is static. >=20 > So: >=20 > 1) Why does the LAN dhcpd respond to the WAN dhclient? Maybe DHCP requests are getting passed across the gateway. Try setting = gateway_enable=3D"NO" temporarily, if that stops the unwanted behaviour = then configure pf to block DHCP requests crossing the gateway. > 2) Is there a better way of specifying this setup, so that it does not > have hard coded addresses in there? >=20 > Thanks in advance for any pointers. >=20 > Tom > _______________________________________________ > freebsd-stable@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-stable > To unsubscribe, send any mail to = "freebsd-stable-unsubscribe@freebsd.org" >=20 -- Bob Bishop rb@gid.co.uk