From owner-freebsd-questions Tue Feb 11 16:15:41 2003 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DBDCF37B405 for ; Tue, 11 Feb 2003 16:15:37 -0800 (PST) Received: from smtp.hispeed.ch (isp247n.hispeed.ch [62.2.95.247]) by mx1.FreeBSD.org (Postfix) with ESMTP id 53F5A43F75 for ; Tue, 11 Feb 2003 16:15:35 -0800 (PST) (envelope-from C.Steiner@elch.ch) Received: from darkstar.elch.ch (dclient217-162-228-227.hispeed.ch [217.162.228.227]) by smtp.hispeed.ch (8.12.6/8.12.6/tornado-1.0) with ESMTP id h1C0FXjR029638 for ; Wed, 12 Feb 2003 01:15:34 +0100 Message-Id: <5.2.0.9.0.20030212003300.00a71e50@www.elch.ch> X-Sender: c.steiner@www.elch.ch X-Mailer: QUALCOMM Windows Eudora Version 5.2.0.9 Date: Wed, 12 Feb 2003 01:13:10 +0100 To: freebsd-questions@freebsd.org From: "C.Steiner" Subject: how to get two IPs from DHCP for one NIC Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Hello ! There is the following problem concerning my gateway: (FreeBSD dynsoft.ch 4.7-RELEASE FreeBSD 4.7-RELEASE #0: Wed Oct 9 15:08:34 GMT 2002 root@builder.freebsdmall.com:/usr/obj/usr/src/sys/GENERIC i386) I've got a rl0 (outer world) and a rl1 (LAN side) NIC setup as IPF/NAT gateway which is working. (with an empty /etc/dhclient.conf file) Here is my /etc/rc.conf file: =========== rc.conf start ====== inetd_enable="NO" sendmail_enable="NONE" portmap_enable="NO" gateway_enable="YES" ipfilter_enable="YES" ipnat_enable="YES" ifconfig_rl0="DHCP" ifconfig_rl1_alias0="inet 10.0.0.1 netmask 255.255.255.0" hostname="dynsoft.ch" kern_securelevel_enable="NO" nfs_reserved_port_only="YES" sshd_enable="YES" usbd_enable="YES" =========== rc.conf end====== I've also a /etc/dhclient-exit-hook script which updates DNS entries when IP is changing. All of this is working well. I've now tried (hard) to get a second IP (which I should be able to get) from DHCP, configured to the same NIC (rl0). To force dhclient to get a second (functional) lease I've added the following lines in dhclient.conf: ======== paste start ============ interface "rl0" { script "/sbin/dhclient-script"; send dhcp-client-identifier "dynsoft.ch"; send host-name "dynsoft.ch"; } pseudo "secondary" "rl0" { script "/sbin/dhclient-secondary"; send dhcp-client-identifier "mysql.dynsoft.ch"; send host-name "mysql.dynsoft.ch"; } ======== paste end ============ like I've seen in the manpages, and on http://www.isc.org/ml-archives/dhcp-server/1999/06/msg00218.html As you can see, I've setup a secondary dhclient-script, which is basicaly a copy of the original one (/sbin/dhclient-script) with some debugging messages included. 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 !! : =============== start of pasting ======================== lease { interface "rl0"; name "secondary"; fixed-address 217.162.228.227; option subnet-mask 255.255.252.0; option routers 217.162.228.1; option dhcp-lease-time 3107; option dhcp-message-type 5; option domain-name-servers 62.2.17.60,62.2.24.162,62.2.17.61,62.2.24.158; option dhcp-server-identifier 62.2.28.73; option broadcast-address 255.255.255.255; option host-name "x1-6-00-30-4f-1d-21-b1"; renew 3 2003/2/12 01:17:50; rebind 3 2003/2/12 01:39:38; expire 3 2003/2/12 01:46:07; } lease { interface "rl0"; fixed-address 217.162.228.227; option subnet-mask 255.255.252.0; option routers 217.162.228.1; option dhcp-lease-time 2790; option dhcp-message-type 5; option domain-name-servers 62.2.17.60,62.2.24.162,62.2.17.61,62.2.24.158; option dhcp-server-identifier 62.2.28.73; option broadcast-address 255.255.255.255; option host-name "x1-6-00-30-4f-1d-21-b1"; renew 3 2003/2/12 01:17:38; rebind 3 2003/2/12 01:40:18; expire 3 2003/2/12 01:46:07; } =============== end of pasting ======================== 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 ?? greetings from switzerland, c.steiner@elch.ch To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message