From owner-freebsd-questions@FreeBSD.ORG Mon Jul 30 00:15:53 2007 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D50A516A41F for ; Mon, 30 Jul 2007 00:15:53 +0000 (UTC) (envelope-from terry@sucked-in.com) Received: from mail.sucked-in.com (got.sucked-in.com [64.251.22.156]) by mx1.freebsd.org (Postfix) with ESMTP id 9A8A313C4A3 for ; Mon, 30 Jul 2007 00:15:53 +0000 (UTC) (envelope-from terry@sucked-in.com) Received: from localhost (localhost [127.0.0.1]) by mail.sucked-in.com (Postfix) with ESMTP id 1CDF81CCF4; Mon, 30 Jul 2007 10:16:24 +1000 (EST) X-Virus-Scanned: amavisd-new at sucked-in.com Received: from mail.sucked-in.com ([127.0.0.1]) by localhost (mail.sucked-in.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4wZoijsxmMXI; Mon, 30 Jul 2007 10:16:23 +1000 (EST) Received: from TerryPC (220-253-13-62.VIC.netspace.net.au [220.253.13.62]) by mail.sucked-in.com (Postfix) with ESMTP id 9F8501CC26; Mon, 30 Jul 2007 10:16:22 +1000 (EST) From: "Terry Sposato" To: "'Jasvinder S. Bahra'" References: <002301c7d10a$09ee5180$0600010a@atlantis> <46ACF835.7040402@crackmonkey.us> <000601c7d238$065da370$0600010a@atlantis> In-Reply-To: <000601c7d238$065da370$0600010a@atlantis> Date: Mon, 30 Jul 2007 10:16:43 +1000 Message-ID: <001101c7d23e$ea6e2200$bf4a6600$@com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcfSODOo9SoOg769QVezzfCgzyfyqQABowkw Content-Language: en-au Cc: freebsd-questions@freebsd.org Subject: RE: Binding dhclient to a particular network interface X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jul 2007 00:15:53 -0000 Hi Jasvinder, I believe if you add the following to /etc/dhclient.conf your problem will be resolved. Interface "ed1"; Then reboot or alternatively restart your network and you should finding it only binding to that interface. Regards, Terry -----Original Message----- From: owner-freebsd-questions@freebsd.org [mailto:owner-freebsd-questions@freebsd.org] On Behalf Of Jasvinder S. Bahra Sent: Monday, 30 July 2007 9:27 AM To: freebsd-questions@freebsd.org Subject: Re: Binding dhclient to a particular network interface Adam, Thanks for responding, but I think theres been a misunderstanding here. The network setup on my machine is working correctly. My switch-facing network card has a fixed IP address, while the cable-modem facing network card is assigned one by the DHCP server built into the cable modem. This is achieved by the following settings in /etc/rc.conf ... network_interfaces="ed1 ed2 lo0" ifconfig_ed1="DHCP" ifconfig_ed2="inet 10.1.0.1 netmask 255.255.255.0" ifconfig_lo0="inet 127.0.0.1" The DHCP reference for ed1 means dhclient is started (thereafter running continuously as a daemon), which sets ed1's IP address to that assigned by the cable modem. Note that dhclient generally runs as a daemon because it has to handle lease renewals and/or expiration. I have no issues with it running as a daemon. However, it is listening on all interfaces (which I do have an issue with), i.e. running the command "sockstat -l4" on my system returns... USER: root COMMAND: dhclient PID: 267 FD: 4 PROTO: udp4 LOCAL ADDRESS: *:68 FOREIGN ADDRESS: *:* As you can see, local address is listed as "*:68", which means its listening on port 68 on all interfaces. I want to instruct dhclient to only listen on my cable-modem facing network card. If this were the case, issuing the "sockstat -l4" command would return as above, but with local address saying "<>:68" (where <> is, unsurprisingly, the IP address assigned to the network card by the DHCP server in the cable modem). Thanks again, Jazz ----- Original Message ----- From: "Adam J Richardson" To: "Jasvinder S. Bahra" Cc: Sent: Sunday, July 29, 2007 9:27 PM Subject: Re: Binding dhclient to a particular network interface > Jasvinder S. Bahra wrote: > > > > Is there a way of instructing dhclient to listen only on the cable-modem > > facing network interface? > > Hi Jazz, > > I don't find it necessary to run dhclient as a daemon. My server has two > interfaces, one wired and one wifi. In my /etc/rc.conf: > > ifconfig_fxp0="DHCP" > ifconfig_ndis0="WPA DHCP" > > [You might recognise ndis as the Project Evil driver for using Windows > network drivers under BSD.] > > When the netstart script runs, those two lines have the effect of > starting wpa_supplicant on ndis0, and running dhclient on both interfaces. > > Supposing I temporarily assign a static IP to fxp0, I can revert to DHCP > by typing: > > $ sudo dhclient fxp0 > > which does some DHCP magic and gets a lease. > > If I take ndis0 down I find I have to run /etc/netstart again to get it > back up, but you didn't want to know that. > > HtH > Adam J Richardson _______________________________________________ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"