From owner-freebsd-questions@FreeBSD.ORG Thu Aug 11 10:17:17 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 A172C16A41F for ; Thu, 11 Aug 2005 10:17:17 +0000 (GMT) (envelope-from matthew@thebunker.net) Received: from male.aldigital.co.uk (male.thebunker.net [213.129.64.13]) by mx1.FreeBSD.org (Postfix) with ESMTP id 13D7743D48 for ; Thu, 11 Aug 2005 10:17:16 +0000 (GMT) (envelope-from matthew@thebunker.net) Received: from lack-of-gravitas.thebunker.net (gateway.ash.thebunker.net [213.129.64.4]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by male.aldigital.co.uk (Postfix) with ESMTP id 84CBD97703; Thu, 11 Aug 2005 11:17:15 +0100 (BST) Received: from lack-of-gravitas.thebunker.net (localhost [127.0.0.1]) by lack-of-gravitas.thebunker.net (8.13.4/8.13.4) with ESMTP id j7BAHFWk036747; Thu, 11 Aug 2005 11:17:15 +0100 (BST) (envelope-from matthew@lack-of-gravitas.thebunker.net) Received: (from matthew@localhost) by lack-of-gravitas.thebunker.net (8.13.4/8.13.4/Submit) id j7BAHEgU036746; Thu, 11 Aug 2005 11:17:14 +0100 (BST) (envelope-from matthew) Date: Thu, 11 Aug 2005 11:17:14 +0100 From: Matthew Seaman To: Sean Murphy Message-ID: <20050811101713.GB19829@lack-of-gravitas.thebunker.net> Mail-Followup-To: Matthew Seaman , Sean Murphy , dave , freebsd-questions@freebsd.org References: <000501c59e02$6ceece00$0200a8c0@satellite> <42FA92B5.30800@calarts.edu> <000701c59e06$9fbfd9b0$0200a8c0@satellite> <42FA9AE9.3040003@calarts.edu> <42FA9CDA.1080504@calarts.edu> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="mxv5cy4qt+RJ9ypb" Content-Disposition: inline In-Reply-To: <42FA9CDA.1080504@calarts.edu> User-Agent: Mutt/1.5.9i Cc: dave , 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 List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Aug 2005 10:17:17 -0000 --mxv5cy4qt+RJ9ypb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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=20 > >>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-questions > >>To unsubscribe, send any mail to=20 > >>"freebsd-questions-unsubscribe@freebsd.org" > >> > > > >try this in your rc.conf > > > >ifconfig_dc0=3D"DHCP" > >ifconfig_dc0=3D"100baseTX mediaopt full-duplex" > > > >ifconfig_dc1=3D"DHCP" > >ifconfig_dc1=3D"100baseTX mediaopt full-duplex" > > > > >=20 > *Correction* >=20 > ifconfig_dc0=3D"DHCP" > ifconfig_dc0=3D"media 100baseTX mediaopt full-duplex" >=20 > ifconfig_dc1=3D"DHCP" > ifconfig_dc1=3D"media 100baseTX mediaopt full-duplex" Unfortunately, that won't work. /etc/rc.conf is part of a shell script, and all of those variable=3Dvalue 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=3D"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). 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 --=20 Dr Matthew J Seaman MA, D.Phil. 8 Dane Court Manor School Rd PGP: http://www.infracaninophile.co.uk/pgpkey Tilmanstone Tel: +44 1304 617253 Kent, CT14 0JL UK --mxv5cy4qt+RJ9ypb Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (FreeBSD) iQCVAwUBQvslqZr7OpndfbmCAQIOsAP+OM8qKJ1Y9jRmQMgHv6JIy5K6vn5pxsn9 ViXxAKiHmCCUdtMqCeyiFtrbseyPTDnE+xrJhFw8elxolsH26fOcwxNqtT32jxsh ko4ZH2xp59tvVfCbPzsdi0sd/gEXXlQItbWbjoUIAKxMDXL7khd+SD8cprKkjvf5 7DOuc1aGJ+c= =eUEf -----END PGP SIGNATURE----- --mxv5cy4qt+RJ9ypb--