You are not logged in.

#1 2009-05-23 18:05:24

leniviy
Member
Registered: 2009-05-23
Posts: 177

dhcp: default gateway not added if ip and gateway in different subnets

Hi! Help needed with Arch's DHCP client. (dhcpcd)

Assume that ISP leased ip 78.37.180.62/24 and gateway 78.37.0.1

On my home router when you plug cable, routing table is like this:

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
78.37.0.1       0.0.0.0         255.255.255.255 UH    0      0        0 eth0
78.37.180.0     0.0.0.0         255.255.255.0   U     202    0        0 eth0
0.0.0.0         78.37.0.1       0.0.0.0         UG    202    0        0 eth0

But on Arch it's much tinyer:

78.37.180.0     *               255.255.255.0   U     202    0        0 eth0

And no internet for me.

I've read that before adding a gateway you need to add a route to that gateway or you get an error: SIOCADDRT: No such process.
I believe this very error is what Arch's dhcp cliet gets when it tries to add the gateway.

Funny thing is if you manually add the route to the gateway, the gateway is auto-added in 5-10 sec.

# route add 78.37.0.1/32 dev eth0
# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
78.37.0.1       *               255.255.255.255 UH    0      0        0 eth0
78.37.180.0     *               255.255.255.0   U     202    0        0 eth0
# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
78.37.0.1       0.0.0.0         255.255.255.255 UH    0      0        0 eth0
78.37.180.0     0.0.0.0         255.255.255.0   U     202    0        0 eth0
0.0.0.0         78.37.0.1       0.0.0.0         UG    202    0        0 eth0

Where to dig? Are the routes added by some script that can be modified?

Last edited by leniviy (2009-05-23 20:22:52)


Arch 64, xfce4

Offline

#2 2009-05-23 18:38:04

leniviy
Member
Registered: 2009-05-23
Posts: 177

Re: dhcp: default gateway not added if ip and gateway in different subnets

also, until correct route is added, someone keeps logging to daemon.log:

May 23 21:27:22 IL dhcpcd: eth0: add_route: No such process
May 23 22:33:05 IL dhcpcd: eth0: send_raw_packet: Network is down
May 23 22:34:54 IL dhcpcd: eth0: add_route: No such process
May 23 22:35:09 IL dhcpcd: eth0: add_route: No such process
May 23 22:35:24 IL dhcpcd: eth0: add_route: No such process
May 23 22:35:39 IL dhcpcd: eth0: add_route: No such process
May 23 22:35:54 IL dhcpcd: eth0: add_route: No such process
May 23 22:36:09 IL dhcpcd: eth0: add_route: No such process
May 23 22:36:24 IL dhcpcd: eth0: add_route: No such process

Arch 64, xfce4

Offline

#3 2009-07-04 00:48:48

rsmarples
Member
Registered: 2009-05-12
Posts: 287

Re: dhcp: default gateway not added if ip and gateway in different subnets

Your DHCP server (I'm guessing an ISP) needs to add a host route to the gateway as it's on a different subnet
This can be done by adding the static route 78.37.0.1 78.37.0.1 or by adding a classless static route.

Offline

#4 2009-07-04 06:03:12

leniviy
Member
Registered: 2009-05-23
Posts: 177

Re: dhcp: default gateway not added if ip and gateway in different subnets

Actually, it turned out to be a bug in my modem's dhcp server. Windows dchp client and also udhcpc handle it nicely, but dhcpcd doesn't.


Arch 64, xfce4

Offline

#5 2009-07-04 06:46:36

rsmarples
Member
Registered: 2009-05-12
Posts: 287

Re: dhcp: default gateway not added if ip and gateway in different subnets

leniviy wrote:

Actually, it turned out to be a bug in my modem's dhcp server. Windows dchp client and also udhcpc handle it nicely, but dhcpcd doesn't.

You're correct - dhcpcd never adds host routes to the gateway unless instructed by the DHCP server.

Offline

Board footer

Powered by FluxBB