Remove the unspecified gateway from linux routing table

Eugène Ngontang sympavali at gmail.com
Tue Feb 17 11:44:11 UTC 2015


Hi,

To answer your questions :
- which distribution is this? / *Fedora 18*
- is dhcp provided by the a package from the distribution, or is it hand
compiled? / *Package*
- which release of dhclient/dhcp is in use? / *Internet Systems Consortium
DHCP Server V3.0.5-RedHat & nternet Systems Consortium DHCP Client 4.2.5*
- dhclient typically calls a script to set the values. Is this script
correct and in place? / *Which script are you talking about here? The
dhclient init script???*



*I've four other systems with exactly the same configuration and connected
to same dhcp server, which are working fine.*



*[PRD][root at hostname]# cat /var/lib/dhclient/dhclient.leaseslease {
interface "eth0";  fixed-address 10.10.10.22;  option subnet-mask
255.255.255.240;  option routers 10.10.10.17;  option dhcp-lease-time
604800;  option dhcp-message-type 5;  option domain-name-servers
1.1.2.3,1.2.2.3;  option dhcp-server-identifier 11.12.254.100;  option
nis-domain "xxx.priv";  option domain-name "fr.mydomain.org
<http://fr.mydomain.org>";  renew 5 2015/02/20 22:26:22;  rebind 1
2015/02/23 14:21:26;  expire 2 2015/02/24 11:21:26;}[PRD][root at hostname]#
cat
/var/lib/dhclient/dhclient-b6a65dbe-6524-4070-b4b7-3cb2b1333187-eth0.leaselease
{  interface "eth0";  fixed-address 10.10.0.22;  option subnet-mask
255.255.255.240;  option dhcp-lease-time 604800;  option routers
10.10.10.17;  option dhcp-message-type 5;  option dhcp-server-identifier
11.12.254.100;  option domain-name-servers 1.1.2.3,1.2.2.3;  option
nis-domain "xxx.priv";  option domain-name "fr.mydomain.org
<http://fr.mydomain.org>";  renew 4 2015/02/19 14:33:43;  rebind 0
2015/02/22 15:00:34;  expire 1 2015/02/23 12:00:34;}lease {  interface
"eth0";  fixed-address 10.10.10.22;  option subnet-mask 255.255.255.240;
option routers 10.10.10.17;  option dhcp-lease-time 604800;  option
dhcp-message-type 5;  option domain-name-servers 1.1.2.3,1.2.2.3;  option
dhcp-server-identifier 10.12.254.100;  option nis-domain "xxx.priv";
option domain-name "fr.mydomain.org <http://fr.mydomain.org>";  renew 4
2015/02/19 17:16:26;  rebind 0 2015/02/22 16:20:59;  expire 1 2015/02/23
13:20:59;}[PRD][root at hostname]# cat
/etc/sysconfig/network-scripts/ifcfg-eth0# Generated by
parse-kickstartUUID=b6a65dbe-6524-4070-b4b7-3cb2b1333187BOOTPROTO=dhcpDEVICE=eth0ONBOOT=yesIPV6INIT=noPERSISTENT_DHCLIENT=yes*
*Are you seeing anything missing here??? Thanks.*

*Regards,*
*Eugène NG*

2015-02-17 12:16 GMT+01:00 Rudy Zijlstra <rudy at grumpydevil.homelinux.org>:

>  Hi Patrick,
>
> I would suggist to find a strong cup of coffee ;)
>
> DHCP is designed to work with no IP routing  in place at all. Please
> consider that DHCP provides the computer with the IP address it is to use.
> Any gateway is dependent on that IP address and CANNOT be assigned before
> the IP address is known.
>
> The correct question is indeed posed by the OP, which is why the gateway
> is not applied from the DHCP response.
>
> Some questions:
> - which distribution is this?
> - is dhcp provided by the a package from the distribution, or is it hand
> compiled?
> - which release of dhclient/dhcp is in use?
> - dhclient typically calls a script to set the values. Is this script
> correct and in place?
>
> Cheers
>
>
>
> Rudy
>
>
> On 17-02-15 11:59, Patrick Trapp wrote:
>
> Perhaps I am not completely awake yet, but don't you have to have the
> default gateway in place to have network communication? That is, doesn't it
> have to precede the DHCP process?
>
>  It sounds to me like you just need to make the default route persistent
> so it will survive a reboot. How that is done depends on the flavor of
> Linux you are running.
>
>  Patrick
>
>
>
> On Feb 17, 2015, at 4:43 AM, Eugène Ngontang <sympavali at gmail.com> wrote:
>
>   Hi all,
>
>  I've a remote linux machine whose the routing table is :
>
>      [root at hostname]# route -n
>     Kernel IP routing table
>     Destination     Gateway         Genmask         Flags Metric Ref
>  Use Iface
>     0.0.0.0         0.0.0.0         0.0.0.0         U     0      0
>  0 eth0
>     10.10.10.16    0.0.0.0         255.255.255.240 U     0      0        0
> eth0
>     169.254.0.0     0.0.0.0         255.255.0.0     U     1002   0
>  0 eth0
>
>  The default gateway I should use is  10.10.10.17, and should be given by
> a linux dhcp server. So to be able to connect to the system I call someone
> on the site ask him to add the route manually (**route add default gw
> 10.10.10.17**).
> When the route has been added I can now connect to the system. And once
> connected when I check the routing table again I have this :
>
>      [root at hostname]# route -n
>     Kernel IP routing table
>     Destination     Gateway         Genmask         Flags Metric Ref
>  Use Iface
>     0.0.0.0         10.10.10.17    0.0.0.0         UG    0      0        0
> eth0 (UG flag means it's up and is the gateway)
>     0.0.0.0         0.0.0.0         0.0.0.0         U     0      0
>  0 eth0
>     10.10.10.16    0.0.0.0         255.255.255.240 U     0      0        0
> eth0
>     169.254.0.0     0.0.0.0         255.255.0.0     U     1002   0
>  0 eth0
>
>  And when I restart the system, it boots without the right default
> gateway, and I'm obliged to call again to set the route manually. The
> dhclient lease file has the good **"option routers"** taken from the dhcp
> server.
>
>  Now I'm trying to remove the unspecified route from the routing table
> but each time I try I'm disconnected from the machine.
>
>  I've tried these different ways  :
>
>      route del -net 0.0.0.0 netmask 0.0.0.0 metric 0
>
>      route del default gw 0.0.0.0
>
>      route del -net 0.0.0.0 gw 0.0.0.0
>
>  The three attempts disconected me from the server, and the guy at the
> other side tells me that each time I try to remove the route the default
> route becomes a star (**default ***). I'm obliged to let him add the route
> again mannualy, and when I'm connected, and I restart the network I lose
> the connection again.
>
>  So my questions are :
> 1) Why does this unspecified default route come back every time?
> 2) How can I (what's the way to) remove it without spoiling the routing
> table (losing the good  default gateway).
>
>  Thanks.
>
>  Regards,
> Eugène NG
>
>
>
>  --
> ngonta_e at epitech.net
> sympavali at gmail.com
> ------------------------------------------------------------
> *Aux hommes il faut un chef, et au*
>
> * chef il faut des hommes! L'habit ne fait pas le moine, mais lorsqu'on te
> voit on te juge! *
>
>  _______________________________________________
> dhcp-users mailing list
> dhcp-users at lists.isc.org
> https://lists.isc.org/mailman/listinfo/dhcp-users
>
>
>
> _______________________________________________
> dhcp-users mailing listdhcp-users at lists.isc.orghttps://lists.isc.org/mailman/listinfo/dhcp-users
>
>
>
> _______________________________________________
> dhcp-users mailing list
> dhcp-users at lists.isc.org
> https://lists.isc.org/mailman/listinfo/dhcp-users
>



-- 
ngonta_e at epitech.net
sympavali at gmail.com
------------------------------------------------------------
*Aux hommes il faut un chef, et au*

* chef il faut des hommes!L'habit ne fait pas le moine, mais lorsqu'on te
voit on te juge!*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/dhcp-users/attachments/20150217/2a7d9249/attachment-0001.html>


More information about the dhcp-users mailing list