Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 Nov 2002 15:17:17 +0100
From:      =?iso-8859-1?q?Ren=E9=20Scharfe?= <l.s.r@web.de>
To:        hackers@FreeBSD.ORG
Subject:   Re: auto-definition of a single network interface
Message-ID:  <200211191517.17242.l.s.r@web.de>
In-Reply-To: <p05200f20b9fd8c66ad17@[192.168.254.205]>
References:  <p05200f20b9fd8c66ad17@[192.168.254.205]>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tuesday 19 November 2002 05:20, Rich Morin wrote:
>    network_interfaces=3DSINGLE
>    ifconfig_single=3D"       inet 192.168.254.193 netmask 255.255.255.0=
"
>    ifconfig_single_alias0=3D"inet 192.168.254.199 netmask 255.255.255.2=
55"

OK, perhaps this can be made even simpler. Put this into your /etc/rc.con=
f
and be done:

   # a hack to ease the configuration of machines with only one NIC
  _single=3D`ifconfig -l link`
  eval ifconfig_${_single}=3D"inet 192.168.254.193 netmask 255.255.255.0"
  eval ifconfig_${_single}_alias0=3D"inet 192.168.254.199 netmask 255.255=
=2E255.0"

Maybe a bit ugly, though. ;-) In case there's more than one interface
you'll get "ifconfig_xxN not found", where xxN is your first link, so
it should be "safe".

Ren=E9


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200211191517.17242.l.s.r>