From owner-freebsd-questions@FreeBSD.ORG Thu Aug 11 18:48:49 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 55D2816A41F for ; Thu, 11 Aug 2005 18:48:49 +0000 (GMT) (envelope-from frank@esperance-linux.co.uk) Received: from mailout.zetnet.co.uk (mailout.zetnet.co.uk [194.247.47.231]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8222F43D49 for ; Thu, 11 Aug 2005 18:48:47 +0000 (GMT) (envelope-from frank@esperance-linux.co.uk) Received: from irwell.zetnet.co.uk ([194.247.47.48] helo=zetnet.co.uk) by mailout.zetnet.co.uk with esmtp (Exim 4.50) id 1E3I6f-0002Yo-Jk for freebsd-questions@freebsd.org; Thu, 11 Aug 2005 19:48:45 +0100 Received: from esperance.zetnet.co.uk (54-144.adsl.zetnet.co.uk [194.247.54.144]) by zetnet.co.uk (8.13.4/8.13.4/Debian-1) with SMTP id j7BImfHo019094 for ; Thu, 11 Aug 2005 19:48:45 +0100 Received: (qmail 51605 invoked by uid 1001); 11 Aug 2005 18:48:35 -0000 From: "Frank Shute" Date: Thu, 11 Aug 2005 19:48:35 +0100 To: Malcolm Kay Message-ID: <20050811184835.GA51552@peach> References: <000501c59e02$6ceece00$0200a8c0@satellite> <42FA9CDA.1080504@calarts.edu> <20050811101713.GB19829@lack-of-gravitas.thebunker.net> <200508112307.45642.malcolm.kay@internode.on.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200508112307.45642.malcolm.kay@internode.on.net> User-Agent: Mutt/1.4.2.1i X-Operating-System: FreeBSD 4.11-RELEASE-p4 i386 X-Organisation: 'Esperance Linux' Cc: dave , Sean Murphy , freebsd-questions@freebsd.org Subject: Re: two dc cards on 5.4 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Frank Shute List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Aug 2005 18:48:49 -0000 On Thu, Aug 11, 2005 at 11:07:45PM +0930, Malcolm Kay wrote: > > On Thu, 11 Aug 2005 07:47 pm, Matthew Seaman wrote: > > On Wed, Aug 10, 2005 at 05:33:30PM -0700, Sean Murphy wrote: > > > Sean Murphy wrote: > > > >dave wrote: > > > >>Hi, > > > >> Thanks for your reply. I'll give that a shot. My > > > >> problem is the dc0 card > > > >>gets it's ip via dhcp, can i still use media and mediaopt > > > >> with dhcp? Thanks. > > > >>Dave. > > > >> > > > >>_______________________________________________ > > > >>freebsd-questions@freebsd.org mailing list > > > >>http://lists.freebsd.org/mailman/listinfo/freebsd-question > > > >>s To unsubscribe, send any mail to > > > >>"freebsd-questions-unsubscribe@freebsd.org" > > > > > > > >try this in your rc.conf > > > > > > > >ifconfig_dc0="DHCP" > > > >ifconfig_dc0="100baseTX mediaopt full-duplex" > > > > > > > >ifconfig_dc1="DHCP" > > > >ifconfig_dc1="100baseTX mediaopt full-duplex" > > > > > > *Correction* > > > > > > ifconfig_dc0="DHCP" > > > ifconfig_dc0="media 100baseTX mediaopt full-duplex" > > > > > > ifconfig_dc1="DHCP" > > > ifconfig_dc1="media 100baseTX mediaopt full-duplex" > > > > Unfortunately, that won't work. /etc/rc.conf is part of a > > shell script, and all of those variable=value lines within it > > are literally assignments to shell variables. Thus all you're > > doing with those lines is setting 'ifconfig_dcX' to the value > > "DHCP" and then immediately resetting it to the value "media > > 100baseTX mediaopt full-duplex". > > > > On recent FreeBSD 6.x you can just combine the lines: > > > > ifconfig_dc0="DHCP media 100baseTX mediaopt full-duplex" > > > > (I can't remember if that also works on 5.x -- you'll need to > > read /etc/network.subr to find out). > > It would seem that the "DHCP" value causes a call to 'dhclient' > rather than 'ifconfig' and dhclient.conf(5) suggests that this is > where the options for a DHCP interface should reside. > > Malcolm Kay I think you are correct. The original poster could try: ifconfig_dc0="DHCP" in rc.conf and: interface "dc0" { media "media 10baseT/UTP"; } in /etc/dhclient.conf. Disclaimer: this is for ISC dhcp (I'm running 4.11, so you have to check the manpage). > > > > > In any case, and certainly for older FreeBSD versions you can > > always create a /etc/start_if.dc0 script, which will be run > > immediately before the ifconfig(8) command generated out of > > /etc/rc.conf. In your case, the script should look like: > > > > #!/bin/sh > > > > ifconfig dc0 media 100baseTX mediaopt full-duplex > > > > but you can put any arbitrary commands in there that you want. > > Ditto for the dc1 interface, except call the script > > /etc/start_if.dc1 (if that isn't bleedingly obvious...) There > > are corresponding /etc/stop_if.XXN scripts that can be created > > to do arbitrary stuff on interface shutdown as well. > > > > Cheers, > > > > Matthew > > _______________________________________________ > 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" > -- Frank echo "f r a n k @ e s p e r a n c e - l i n u x . c o . u k" | sed 's/ //g' --->PGP keyID: 0x10BD6F4B<---