Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
netifrc + wlan + dhcp + static route
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Uli-DD-70
n00b
n00b


Joined: 15 Nov 2015
Posts: 2

PostPosted: Sun Nov 15, 2015 8:01 pm    Post subject: netifrc + wlan + dhcp + static route Reply with quote

Hello,

my box is configured to use wlan via wpa_supplicant using dhcp. On my dhcp-server there is an entry for one static route (host route via gateway).
Problem: The netifrc scripts on client side do not add this given static route as a host-route; the routing table shows a route without gateway address.
Btw., dhcpd gives the right data when asking my dhcp-server.

This problem occures since an update this summer, I don't know anymore which packages are new, think about dhcpd or wpa_supplicant.

Here's server's dhcpd.conf:

Code:

default-lease-time 3600;        # 1 hour
max-lease-time 259200;          # 3 days

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

option domain-name "xxx.xxx";
option domain-name-servers 10.0.0.1;
option broadcast-address 192.168.178.255;
option routers 192.168.178.1;
option subnet-mask 255.255.255.0;
option static-routes 10.0.0.1 192.168.178.6;

subnet 192.168.178.0 netmask 255.255.255.0
  {
   range 192.168.178.20 192.168.178.199;
  }


Here's the response from dhcpd on my client when starting interface wlan0:

Quote:

Nov 15 00:52:03 aphrodite dhcpcd[6076]: wlan0: carrier acquired
Nov 15 00:52:03 aphrodite dhcpcd[6076]: wlan0: IAID 5d:7c:0d:88
Nov 15 00:52:03 aphrodite dhcpcd[13460]: sending commands to master dhcpcd process
Nov 15 00:52:03 aphrodite dhcpcd[6076]: control command: dhcpcd -m 2002 wlan0
Nov 15 00:52:04 aphrodite dhcpcd[6076]: wlan0: rebinding lease of 192.168.178.122
Nov 15 00:52:04 aphrodite dhcpcd[6076]: wlan0: leased 192.168.178.122 for 3522 seconds
Nov 15 00:52:04 aphrodite dhcpcd[6076]: wlan0: adding route to 192.168.178.0/24
Nov 15 00:52:04 aphrodite dhcpcd[6076]: wlan0: adding host route to 10.0.0.1 via 192.168.178.6 --> this is the special host route, response from dhcp-server ok
Nov 15 00:52:04 aphrodite dhcpcd[6076]: wlan0: adding default route via 192.168.178.1
Nov 15 00:52:04 aphrodite dhcpcd[6076]: wlan0: removing route to 192.168.178.0/24


As you can see, dhcpd tells the right host route via the right interface

But the resulting kernel routing table looks like this:

Quote:

ip route list
default via 192.168.178.1 dev wlan0 metric 302
10.0.0.1 dev wlan0 metric 302 ---> this line is wrong, I can't ping 10.0.0.1, gateway missing
127.0.0.0/8 dev lo scope host
127.0.0.0/8 via 127.0.0.1 dev lo
192.168.178.0/24 dev wlan0 proto kernel scope link src 192.168.178.122 metric 302


If I manually run this:

Quote:

ip route add 10.0.0.1 via 192.168.178.6


it works and I can ping the 10.0.0.1!!!
Routing table like this:
Quote:

ip route list
default via 192.168.178.1 dev wlan0 metric 302
10.0.0.1 dev wlan0 metric 302
10.0.0.1 via 192.168.178.6 dev wlan0 --> here is the difference!
127.0.0.0/8 dev lo scope host
127.0.0.0/8 via 127.0.0.1 dev lo
192.168.178.0/24 dev wlan0 proto kernel scope link src 192.168.178.122 metric 302


Can someone tell me, why the host route is not added correctly?

Thank You for your help, Uli
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6835
Location: Blighty

PostPosted: Mon Nov 16, 2015 7:36 pm    Post subject: Reply with quote

Looks like a bug with dhcpcd to me!

Code:
Nov 15 00:52:04 aphrodite dhcpcd[6076]: wlan0: adding default route via 192.168.178.1
Nov 15 00:52:04 aphrodite dhcpcd[6076]: wlan0: removing route to 192.168.178.0/24


That by itself is a problem.

What dhcpcd version are you running? If not 6.9.3, could you try upgrading please?
If you are running 6.9.3, can you try the 9999 ebuild to see if it's already fixed?
_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Back to top
View user's profile Send private message
Uli-DD-70
n00b
n00b


Joined: 15 Nov 2015
Posts: 2

PostPosted: Wed Nov 18, 2015 4:46 pm    Post subject: Reply with quote

My dhcpcd was 6.9.0. I've tried both 6.9.3 and 9999. No difference...

Btw.: The message "dhcpcd[6076]: wlan0: removing route to 192.168.178.0/24" looks like a problem, but my routing table still has an entry for that route:

Quote:

default via 192.168.178.1 dev wlan0 metric 302
10.0.0.1 dev wlan0 metric 302 ---> this line is wrong, I can't ping 10.0.0.1, gateway missing
127.0.0.0/8 dev lo scope host
127.0.0.0/8 via 127.0.0.1 dev lo
192.168.178.0/24 dev wlan0 proto kernel scope link src 192.168.178.122 metric 302


Problem still the host route to 10.0.0.1.

Anyone an idea?

Thanks Uli
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6835
Location: Blighty

PostPosted: Wed Nov 18, 2015 9:24 pm    Post subject: Reply with quote

Yup, a bug.
I fixed it here:
http://roy.marples.name/projects/dhcpcd/info/0a516394ccc77128
and here:
http://roy.marples.name/projects/dhcpcd/info/da3590c3991d6c25

If you emerge the 9999 ebuild again it should now be fixed ..... post back here with results please!
_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum