Re: Alias address and DHCP

Michael Sierchio <[email protected]>
Newsgroups gmane.comp.security.firewalls.m0n0wall
Message-ID <CAHu1Y70vyx7x8TjSi+SCYduWgDz2Afo3i4PGBxE3V0x0W8=DQg@mail.gmail.com>
Sorry, failed to read the context properly - m0n0wall!  Ha!  Well, if
you ever want to do this on a naked FreeBSD box... ;-)

On Thu, Aug 11, 2011 at 10:05 AM, Michael Sierchio <[email protected]> wrote:
> Hej, Anders -
>
> You might need to make some changes to this.  It goes in /etc/rc.d or
> /usr/local/etc/rc.d (more properly).
>
> in /etc/rc.conf you'll need to set dhclient-alias_enable="YES", and
> the other variables too
>
> dhclient-alias_if
> dhclient-alias_addr
> dhclient-alias_mask
>
> - M
>
> #!/bin/sh
> #
> # skript för Anders - [email protected]
>
> # PROVIDE: dhclient-alias
> # KEYWORD: nojail nostart
> # REQUIRE: dhclient
>
> . /etc/rc.subr
> . /etc/network.subr
>
> name="dhclient-alias"
> start_cmd="dhclient-alias_start"
> stop_cmd="dhclient-alias_stop"
>
> dhclient-alias_start()
> {
>        ifconfig $dhclient-alias_if inet $dhclient-alias_addr netmask
> $dhclient-alias_mask alias
> }
>
> dhclient-alias_stop()
> {
>        ifconfig $dhclient-alias_if inet $dhclient-alias_addr -alias
> }
>
>
> load_rc_config $name
>
> dhclient-alias_if=${dhclient-alias_if:-eth0}
> dhclient-alias_addr=${dhclient-alias_if:-192.168.0.123}
> dhclient-alias_mask=${dhclient-alias_if:-255.255.255.255}
>
> run_rc_command "$1"
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.