Bug 555870 - dhclient does not get rfc3442 classless static routes
Summary: dhclient does not get rfc3442 classless static routes
Status: RESOLVED FIXED
Alias: None
Product: openSUSE 11.3
Classification: openSUSE
Component: Network (show other bugs)
Version: Factory
Hardware: x86-64 openSUSE 11.3
: P3 - Medium : Enhancement with 5 votes (vote)
Target Milestone: Factory
Assignee: Marius Tomaschewski
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-11-16 17:16 UTC by Dmitry Kholodilov
Modified: 2016-04-15 10:31 UTC (History)
0 users

See Also:
Found By: Community User
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
dhclient-exit-hooks (1.49 KB, text/plain)
2009-11-16 17:16 UTC, Dmitry Kholodilov
Details
dhclient.conf (1.52 KB, text/plain)
2009-11-16 17:17 UTC, Dmitry Kholodilov
Details
Code catching some rfc corner cases -- v1 (1.34 KB, text/plain)
2010-04-29 15:01 UTC, Marius Tomaschewski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dmitry Kholodilov 2009-11-16 17:16:11 UTC
Created attachment 327730 [details]
dhclient-exit-hooks

I'm connected to the LAN and my provider sends classless static routes through
DHCP. But dhclient utility, that works with NetworkManager, does not set this
routes. So, when I've connected to the Internet with VPN (pptp) I can't access
local resources.

My routing table looks like:
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
10.55.88.0      *               255.255.254.0   U     1      0        0 eth0
default         10.55.88.1      0.0.0.0         UG    0      0        0 eth0

However, the problem is solvable: exit hook script is needed to set rfc3442
classless static routes using dhclient. Debian and Ubuntu linux distributions
use this solution. 
I've attached the file "dhcp-exit-hooks", that placed in my /etc dir. This
script does work on setting the routes. Also, in "dhclient.conf" file we need
to add line:

option rfc3442-classless-static-routes code 121 = array of unsigned integer 8;

and "rfc3442-classless-static-routes" in request list. I've attached this file
too.

So, with additional configuration my routing table looks like:
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
85.112.113.96   10.55.88.1      255.255.255.240 UG    0      0        0 eth0
192.188.189.0-n 10.55.88.1      255.255.255.0   UG    0      0        0 eth0
192.168.254.0   10.55.88.1      255.255.255.0   UG    0      0        0 eth0
oivt-net.mipt.r 10.55.88.1      255.255.254.0   UG    0      0        0 eth0
10.55.88.0      *               255.255.254.0   U     1      0        0 eth0
81.5.88-net.mip 10.55.88.1      255.255.252.0   UG    0      0        0 eth0
campus-net-80.0 10.55.88.1      255.255.252.0   UG    0      0        0 eth0
81.5.64.0       10.55.88.1      255.255.240.0   UG    0      0        0 eth0
93.182.0.0      10.55.88.1      255.255.192.0   UG    0      0        0 eth0
172.16.0.0      10.55.88.1      255.240.0.0     UG    0      0        0 eth0
10.0.0.0        10.55.88.1      255.0.0.0       UG    0      0        0 eth0
default         10.55.88.1      0.0.0.0         UG    0      0        0 eth0

And local resources are accessible with VPN connection.

I think this behavior should be used by default, or at least, be configurable.
Comment 1 Dmitry Kholodilov 2009-11-16 17:17:07 UTC
Created attachment 327732 [details]
dhclient.conf
Comment 2 Marius Tomaschewski 2009-11-22 20:17:15 UTC
Yes, it makes sense to add classless route support to dhclient-script.

When you're using ifup and not NetworkManager: just change back and use
'dhcpcd' and not 'dhclient' -- it contains support for classless routes.

Although adding it to dhclient-script will not help with NetworkManager,
because NetworkManager is AFAIK using own script (own binary) and has
to implement it there...
Comment 3 Marius Tomaschewski 2010-04-29 15:01:49 UTC
Created attachment 357806 [details]
Code catching some rfc corner cases -- v1

The above code catches the 0.0.0.0 link local route (and some invalid
gateways) as well as destinations like 129.210.177.132/25, that have
to be corrected to 129.210.177.128/25.

I'm working e.g. on some input data checks as /42 length or when the
net_length needs more data than provided, because they cause syntax
errors.

When you have some ideas how to improve the code, let me know.
Comment 4 Marius Tomaschewski 2010-05-07 15:03:08 UTC
OK, it is included in this submission request:

 39653  State:new     By:mtomaschewski When:2010-05-07T17:00:52
        submit:       network:dhcp/dhcp  ->                              openSUSE:Factory       
        Descr: update to 4.1.1, including dhcpv6 support
Comment 5 Marius Tomaschewski 2010-05-10 13:03:13 UTC
BTW: See also
http://download.opensuse.org/repositories/network:/dhcp/
Comment 6 Bernhard Wiedemann 2016-04-15 10:31:58 UTC
This is an autogenerated message for OBS integration:
This bug (555870) was mentioned in
https://build.opensuse.org/request/show/39792 Factory / dhcp