Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 12 Feb 2003 14:18:02 -0700
From:      "Jamie Hermans" <freebsd@hermans.ca>
To:        <freebsd-questions@freebsd.org>, "C.Steiner" <C.Steiner@elch.ch>
Subject:   Re: how to get two IPs from DHCP for one NIC
Message-ID:  <017301c2d2dc$3a6ee760$3d07000a@jhermansxp>
References:  <5.2.0.9.0.20030212003300.00a71e50@www.elch.ch>

next in thread | previous in thread | raw e-mail | index | archive | help
----- Original Message ----- 
From: "C.Steiner" <C.Steiner@elch.ch>
To: <freebsd-questions@freebsd.org>
Sent: Tuesday, February 11, 2003 5:13 PM
Subject: how to get two IPs from DHCP for one NIC


> After firing this thing up,
> I ended up with only one IP bound to rl0, and in /var/db/dhclient.leases 
> there were two leases, one for the original interface, and one for the
> secondary, but both of them with the same (functional) IP, and both of
> them with the same host-name !! :

<snip>
 
> I've tried to adapt that dhclient-secondary script, but It wasn'
> successfull. I think that maybe the ISP DHCP Server checks the MAC
> address of my NIC, and so I get the same IP again, when dhclient
> requests the second IP.
> 
> Has anybody a clue how to solve this ??


This has worked for me ... your mileage may vary.


/etc/dhclient-secondary.sh
-----
#!/bin/sh

if [ -x /usr/bin/logger ]; then
 LOGGER="/usr/bin/logger -s -p user.notice -t dhclient"
else
 LOGGER=echo
fi

exit_status=$1

ifconfig $interface inet alias $new_ip_address \
 netmask 255.255.255.255 > /dev/null 2>&1

$LOGGER "New (secondary) IP Address ($interface): $new_ip_address"

exit $exit_status
-----


/etc/dhclient.conf
-----
interface "fxp0" {
 send dhcp-client-identifier "zinebar";
 supersede domain-name "hermans.ca inside wireless";
 supersede domain-name-servers 0.0.0.0;
}

pseudo "secondary" "fxp0" {
 send dhcp-client-identifier "zinebar2";
 script "/etc/dhclient-secondary";
}
-----


-- Jamie


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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?017301c2d2dc$3a6ee760$3d07000a>