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 <kudzu at tenebras dot com> 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 - kudzu at tenebras dot com
>
> # 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"
>
|