Date: Thu, 21 Feb 2008 12:35:23 +0000 From: "Siraj Shaikh" <siraj.shaikh@gmail.com> To: Mel <fbsd.questions@rachie.is-a-geek.net> Cc: freebsd-questions@freebsd.org Subject: Re: IP Aliasing Message-ID: <3b2ddd940802210435n5d460dc1l82615e927255e2a6@mail.gmail.com> In-Reply-To: <200802211333.36144.fbsd.questions@rachie.is-a-geek.net> References: <3b2ddd940801280627m6d747cd1g27682bcd9e50ceb7@mail.gmail.com> <200801290234.m0T2YtLn074403@banyan.cs.ait.ac.th> <3b2ddd940802210407j7b83059duabadeccaec53a26c@mail.gmail.com> <200802211333.36144.fbsd.questions@rachie.is-a-geek.net>
next in thread | previous in thread | raw e-mail | index | archive | help
On 21/02/2008, Mel <fbsd.questions@rachie.is-a-geek.net> wrote: > On Thursday 21 February 2008 13:07:08 Siraj Shaikh wrote: > > > ifconfig_ed0_alias0="inet 127.0.0.251 netmask 0xffffffff" > > ifconfig_ed0_alias1="inet 127.0.0.252 netmask 0xffffffff" > > ifconfig_ed0_alias2="inet 127.0.0.253 netmask 0xffffffff" > > > > Just want to know, as I want to configure about 253 addresses as an > > alias on a single machine (along with the primary address, this will > > be 254 address, a whole C-class subnet) - and would like these entries > > to hold when I boot. Also, is there any shortcut to adding a range of > > net/host address or would I have to add a line for each address? > > > Yes and yes. Yes it needs one line per alias and yes, there's a shortcut: > > for i in $(jot - 0 254); do > echo ifconfig_ed0_alias${i}="\"inet 127.0.0.$((i+1)) netmask 0xffffffff\"" > done >>/etc/rc.conf > > Wouldn't do this with 127.0.0 btw, but I figured you wouldn't. You'd also have > to make a provision for the main IP, but then again, it's easier to remove > the specific line by hand. > -- > > Mel > Thanks Mel - very helpful indeed Siraj
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3b2ddd940802210435n5d460dc1l82615e927255e2a6>