Keep loosing WAN IP Address - dhclient does not seem to do update
-
have done some research, and it seems that the problem is dhclient and not pfsense, this guy is not using pfsense:
http://lists.freebsd.org/pipermail/freebsd-current/2005-October/056279.html
-
That was from 2005. Since then dhclient was replaced with a version from OpenBSD.
-
well,, the error is the same:
"short write: wanted 21 got 0 bytes" -
well,, the error is the same:
"short write: wanted 21 got 0 bytes"Yeah, that's very strange. Just to make sure, you are on the latest testing snapshot?
-
i have the same problem, and i have done this (no warranty!):
edit /etc/rc.newwanip
and in the beginning of the file i added:if($curwanip == "0.0.0.0") {
log_error("Failed to update WAN IP, restarting dhclient.");
exec("dhclient rl0");
}
–----------------------------------------------------------------------------------
Replace "rl0" with you WAN interface!
It would look like this:/* WAN IP address has changed */
$argument = str_replace("\n", "", $argv[1]);
if($argument <> "") {
$curwanip = find_interface_ip($argument);
$interface = convert_real_interface_to_friendly_interface_name($argument);
if($curwanip == "")
$curwanip = get_current_wan_address();
} else {
$curwanip = get_current_wan_address();
$interface = "wan";
}
if($curwanip == "0.0.0.0") {
log_error("Failed to update WAN IP, restarting dhclient.");
exec("dhclient rl0");
}THANKS SO MUCH!
This works like a charm. My ISP drops my IP from time to time, it was annoying because pfsense doesn't auto-renew it for whatever reason. I'm running in vmware. It works fine now! I can see it in the system logs as it happens.
-
Nice to hear it worked !! :D
-
well,, the error is the same:
"short write: wanted 21 got 0 bytes"Yeah, that's very strange. Just to make sure, you are on the latest testing snapshot?
Yes, im using 2006-12-14 right now, maybe its time to upgrade dhclient to 3.0.5 if its possibly ?? or even replace dhclient.
-
yeah, definately looks like the same error. What drives me crazy is that the versions before 1.0 of Pfsense worked flawlessly concerning the dhclient Wan IP issue. Was there a version change?
Cheers
fireseller -
Everyone having problems please replace /etc/rc.newwanip with http://pfsense.com/cgi-bin/cvsweb.cgi/pfSense/etc/rc.newwanip?rev=1.21.2.23;content-type=text%2Fplain;only_with_tag=RELENG_1
Let me know.. Thanks!
-
Sorry to say, but I have tested another firewall and all my problems disappeared.
The thing about my ISP is changing my IP a lot.. Yea, it disappeared. Clearly it was pfsense. On the new firewall I have had the same WAN IP since the installation ~2 days ago.The weird part about this is that pfsense has been working before without problem. All problems started when I changed my ISP. So.. again, not expert, but I believe ISP have different ways to give IP's and pfsense can't handle them all in a correct manner.
On the new firewall I can see in the logs that it comes false dhcp offers from time to time on the WAN. The new firewall just drops this. Maybe pfsense doesn't? Anyway, I have no clue… -
Everyone having problems please replace /etc/rc.newwanip with http://pfsense.com/cgi-bin/cvsweb.cgi/pfSense/etc/rc.newwanip?rev=1.21.2.23;content-type=text%2Fplain;only_with_tag=RELENG_1
Let me know.. Thanks!
it looks like it could work, BUT ! i got this:
Dec 17 15:25:11 dhclient[11983]: exiting.
Dec 17 15:25:11 dhclient[11983]: exiting.
Dec 17 15:25:11 dhclient[11983]: connection closed
Dec 17 15:25:11 dhclient[11983]: connection closed
Dec 17 15:25:11 dhclient[11982]: exiting.
Dec 17 15:25:11 dhclient[11982]: exiting.
Dec 17 15:25:11 dhclient[11982]: wan: not found
Dec 17 15:25:11 dhclient[11982]: wan: not found
Dec 17 15:25:11 php: : Failed to update WAN IP, restarting dhclient.
Dec 17 15:25:11 php: : Informational: rc.newwanip is starting.it seems like the script is using "wan" as a real interface name.
maybe it should be like this ? :
exec("dhclient {$argument}"); -
I don't know if this new script fixes the Loose IP Problem. But after replacing the old version with the new one I had problems with my OpenVPN. Always the script tried to re synced the OpenVPN, I received a error:
Port [undef] 1194 already bound
I use the pfSense-1.0.1-Embedded.img.gz with just changing the /etc/rc.newwanip to the proposed version.
-
Nextrem: not related, known issue, please see the openvpn threads.
Everyone else:
I have updated rc.newwanip, try this version:
http://pfsense.com/cgi-bin/cvsweb.cgi/pfSense/etc/rc.newwanip?rev=1.21.2.24;content-type=text%2Fplain;only_with_tag=RELENG_1
-
Thx sullrich
Just replaced and rebooted. Let's hope the best ;)
Cheers
fireseller -
i think i can confirm that the new script is working !! ;D
Dec 18 18:12:34 php: : Informational: DHClient spawned /etc/rc.newwanip and the new ip is wan - 90.224.168.54.
Dec 18 18:12:29 login: login on ttyv0 as root
Dec 18 18:12:29 php: : Informational: rc.newwanip is starting.
Dec 18 18:12:28 check_reload_status: rc.newwanip starting
Dec 18 18:12:25 dhclient: /sbin/route add default 90.224.168.1
Dec 18 18:12:25 dhclient: New Routers (rl0): 90.224.168.1
Dec 18 18:12:25 dhclient: New Broadcast Address (rl0): 90.224.168.255
Dec 18 18:12:25 dhclient: New Subnet Mask (rl0): 255.255.255.0
Dec 18 18:12:25 dhclient: New IP Address (rl0): 90.224.168.54
Dec 18 18:12:23 php: : Failed to update WAN IP, restarting dhclient.
Dec 18 18:12:23 php: : Informational: rc.newwanip is starting.
Dec 18 18:12:23 check_reload_status: rc.newwanip starting
–---------------------------
however, i dont think this script will solve the "short write: wanted 21 but got 0 bytes" error, or does it ? -
It does not solve it, it simply works around the issue for the time being. Anyone else tested?
-
i know, but i think there is two errors,
first, when it failes to update the wan ip, that have been "solved" with the script.
but the second with "short write" will not be solved by this, i think. -
i can confirm that the new script (rc.newwanip) is working great !!! ;D :D ;D
-
Yay! Anyone else?
-
Sorry but the new script is NOT running great, after 1 day again the connection got lost:
Dec 20 05:59:32 last message repeated 3 times
Dec 20 05:59:12 dhcpd: send_packet: Permission denied
Dec 20 05:52:02 last message repeated 2 times
Dec 20 05:51:51 dhcpd: send_packet: Permission denied
Dec 20 01:52:17 dhclient[268]: exiting.
Dec 20 01:52:17 dhclient[268]: exiting.
Dec 20 01:52:17 dhclient[268]: short write: wanted 21 got 0 bytes
Dec 20 01:52:17 dhclient[268]: short write: wanted 21 got 0 bytes
Dec 20 01:52:17 dhclient[268]: DHCPACK from 10.215.0.1
Dec 20 01:52:17 dhclient[268]: DHCPREQUEST on xl1 to 255.255.255.255 port 67
Dec 20 01:50:24 dhclient[268]: DHCPREQUEST on xl1 to 10.215.0.1 port 67
Dec 20 01:49:37 last message repeated 24 times
Dec 20 01:38:42 last message repeated 14 times
Dec 20 01:29:57 last message repeated 4 times
Dec 20 01:28:08 last message repeated 2 times
Dec 20 01:27:48 dhclient[268]: DHCPREQUEST on xl1 to 10.215.0.1 port 67
Dec 20 01:01:03 php: : phpDynDNS: No Change In My IP Address and/or 25 Days Has Not Past. Not Updating Dynamic DNS Entry.
Dec 20 01:01:03 php: : DynDns: Cached IP: 84.75.14.209
Dec 20 01:01:03 php: : DynDns: Current WAN IP: 84.75.14.209
Dec 20 01:01:03 php: : DynDns: _detectChange() starting.
Dec 20 01:01:03 php: : DynDns: updatedns() starting
Dec 20 01:01:03 php: : DynDns: Running updatedns()This is starting to be render PFSense unusable for me. Every 30 bucks router can keep the ip from my isp for several months (last setup). Is it not possible to use the dhclient from the pre 1.0 versions???
Sorry for no better news.