# net.eth0 doesn't establish default route retrieved from dhcp

## ayvango

I had switched my internet provider and got strange problem: default route is not setting with /etc/init.d/net.eth0 start. All settings are retrieved from dhcp including route. IP address and netmask are set as usual, but route not. Every time I connect to this specific provider I need to add route manually. This behaviour is common for native gentoo installation and for calculate (gentoo derivative) installation.

Here is some infomration about network

```

# /etc/init.d/net.eth0 restart

# ip ro list

10.0.0.0/8 via 10.0.59.129 dev eth0  metric 10 

10.0.59.128/26 dev eth0  proto kernel  scope link  src 10.0.59.178  metric 10 

127.0.0.0/8 dev lo  scope host 

127.0.0.0/8 via 127.0.0.1 dev lo 

195.98.64.65 via 10.0.59.129 dev eth0  metric 10 

195.98.64.66 via 10.0.59.129 dev eth0  metric 10 

# ip ro get 8.8.8.8

RTNETLINK answers: Network is unreachable

```

```

# dhcpcd -T eth0

dhcpcd[23791]: version 6.2.0 starting

dhcpcd[23791]: DUID 00:01:00:01:1a:ce:8d:6d:b8:76:3f:0e:00:93

dhcpcd[23791]: eth0: IAID 84:60:3d:96

dhcpcd[23791]: eth0: soliciting an IPv6 router

dhcpcd[23791]: eth0: rebinding lease of 10.0.59.178

dhcpcd[23791]: eth0: leased 10.0.59.178 for 3600 seconds

interface=eth0

pid=23791

reason=TEST

skip_hooks=lookup-hostname

new_broadcast_address=10.0.59.191

new_classless_static_routes='195.98.64.65/32 10.0.59.129 195.98.64.66/32 10.0.59.129 10.0.0.0/8 10.0.59.129'

new_dhcp_lease_time=3600

new_dhcp_message_type=5

new_dhcp_server_identifier=10.255.249.194

new_domain_name_servers='195.98.64.65 195.98.64.66'

new_ip_address=10.0.59.178

new_ms_classless_static_routes='195.98.64.65/32 10.0.59.129 195.98.64.66/32 10.0.59.129 10.0.0.0/8 10.0.59.129'

new_network_number=10.0.59.128

new_ntp_servers=195.98.64.84

new_routers=10.0.59.129

new_sixrd='10 42 2a00:1af8:0a00:0000:0000:0000:0000:0000 10.63.255.254'

new_subnet_cidr=26

new_subnet_mask=255.255.255.192

dhcpcd[23791]: exited

```

And all is fixed after establishing route manually:

```

ip ro add default via 10.0.59.129

```

I search for solution in two forms: some triggered hardcoded script that would check if this specific provider is used and set this single route. Other solution, that I would prefere, is to patch basic network scripts that work with dhcp to make them interpret correctly  dhcpcd output similar to provided in the question.

I can make this changes by myself, but I have no knowledge on where I should seek code (or scripts) that I need to write patch for.

----------

## UberLord

 *ayvango wrote:*   

> I had switched my internet provider and got strange problem: default route is not setting with /etc/init.d/net.eth0 start. All settings are retrieved from dhcp including route. IP address and netmask are set as usual, but route not. Every time I connect to this specific provider I need to add route manually. This behaviour is common for native gentoo installation and for calculate (gentoo derivative) installation.
> 
> Here is some infomration about network
> 
> ```
> ...

 

Your ISP is not suppling a default route in the classless_static_routes option.

http://tools.ietf.org/html/rfc3442#page-5

 *Quote:*   

> 
> 
>    If the DHCP server returns both a Classless Static Routes option and
> 
>    a Router option, the DHCP client MUST ignore the Router option.

 

Tell them to fix it.

----------

