From owner-freebsd-bugs@freebsd.org Tue Oct 10 12:54:26 2017 Return-Path: Delivered-To: freebsd-bugs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8685CE3096A for ; Tue, 10 Oct 2017 12:54:26 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 74F2E807EE for ; Tue, 10 Oct 2017 12:54:26 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id v9ACsQYP017257 for ; Tue, 10 Oct 2017 12:54:26 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 222899] After lease expiration dhclient-script mess up network Date: Tue, 10 Oct 2017 12:54:26 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: 10.4-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: cab902@yahoo.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 12:54:26 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D222899 Bug ID: 222899 Summary: After lease expiration dhclient-script mess up network Product: Base System Version: 10.4-RELEASE Hardware: Any OS: Any Status: New Severity: Affects Some People Priority: --- Component: bin Assignee: freebsd-bugs@FreeBSD.org Reporter: cab902@yahoo.com Configuration is like this: /etc/dhclient.conf: alias { interface "rl0"; fixed-address 192.168.1.5; option subnet-mask 255.255.255.0; } So, we have a dynamic address and fixed alias address. So the interface looks like this: rl0: flags=3D8843 metric 0 mtu 1500 options=3D2008 ether xx:xx:xx:xx:xx:xx hwaddr xx:xx:xx:xx:xx:xx inet 192.168.0.11 netmask 0xffffff00 broadcast 192.168.0.255 inet 192.168.1.5 netmask 0xffffff00 broadcast 192.168.1.255 nd6 options=3D29 media: Ethernet autoselect (100baseTX ) status: active But, after the lease expires, dhclient-script renews lease, removes old dyn= amic address and adds the new one, at the end of the list. Now it looks like thi= s: rl0: flags=3D8843 metric 0 mtu 1500 options=3D2008 ether xx:xx:xx:xx:xx:xx hwaddr xx:xx:xx:xx:xx:xx inet 192.168.1.5 netmask 0xffffff00 broadcast 192.168.1.255 inet 192.168.0.11 netmask 0xffffff00 broadcast 192.168.0.255 nd6 options=3D29 media: Ethernet autoselect (100baseTX ) status: active This has an unintended consequence, that the default route now goes through fixed alias interface, instead of dynamic interface. As the machine is the router, it messes up the access to the outside for the rest of the local network. I propose a fix like this: --- dhclient-script.orig 2017-10-09 18:46:39.912218000 +0200 +++ dhclient-script.new 2017-10-09 21:27:45.784826000 +0200 @@ -345,6 +345,7 @@ add_new_routes fi if [ "$new_ip_address" !=3D "$alias_ip_address" ]; then + delete_old_alias add_new_alias fi if is_default_interface; then It will, in the RENEW phase, remove and add the alias, which will put it be= hind the dynamic address, like it's suppose to be: rl0: flags=3D8843 metric 0 mtu 1500 options=3D2008 ether xx:xx:xx:xx:xx:xx hwaddr xx:xx:xx:xx:xx:xx inet 192.168.0.11 netmask 0xffffff00 broadcast 192.168.0.255 inet 192.168.1.5 netmask 0xffffff00 broadcast 192.168.1.255 nd6 options=3D29 media: Ethernet autoselect (100baseTX ) status: active Now the default route will again go through the dynamic address. --=20 You are receiving this mail because: You are the assignee for the bug.=