Query on default gateway with DHCP vs Static address

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Query on default gateway with DHCP vs Static address

SIMON BABY
Hi,
I have a query about the DHCP provided IP address vs Static IP address configured manually.  When i get the IP address from DHCP, I can ping to 8.8.8.8 (google public server) where as
with a statically configured IP address, I could not.  When I looked into the route table (route -n ), I did not see any default gateway with DHCP or Statically configured IP.  (I am testing with Linux).

1. Can I know when the packet goes out , how did the hardware (NIC) find the default gateway in the case of the DHCP provided IP address since I did not see any default gw IP in the routing table?
2. With statically configured IP, if I explicitly configure a default GW, I can see packets are going out and receiving. I can see the default GW in the routing table. Do I need a default GW to send packets from a statically configured IP address ?

Thank you for your time

Regards
Simon
 

_______________________________________________
ISC funds the development of this software with paid support subscriptions. Contact us at https://www.isc.org/contact/ for more information.

dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
Reply | Threaded
Open this post in threaded view
|

Re: Query on default gateway with DHCP vs Static address

Peter Yardley-2
Hi,

This is prolly a problem with your configuration. Are you using ISC DHCPd? If so could provide a relevant snippet of your configuration, anonymised if necessary.

I used to configure subnets like this …

subnet 10.20.50.0 netmask 255.255.254.0 {
    option subnet-mask 255.255.254.0;
    option broadcast-address 10.20.51.255;
    option routers 10.20.50.1;

    pool {
        # A device for Blah
        host HMTXYZ           { hardware ethernet 00:40:9d:54:4c:c7;
                                        fixed-address 10.20.50.32; }
        …

        range 10.20.51.0 138.25.51.254;
    }

Of course there are many other correct possiblities


> On 19 Mar 2021, at 10:03 am, SIMON BABY <[hidden email]> wrote:
>
> Hi,
> I have a query about the DHCP provided IP address vs Static IP address configured manually.  When i get the IP address from DHCP, I can ping to 8.8.8.8 (google public server) where as
> with a statically configured IP address, I could not.  When I looked into the route table (route -n ), I did not see any default gateway with DHCP or Statically configured IP.  (I am testing with Linux).
>
> 1. Can I know when the packet goes out , how did the hardware (NIC) find the default gateway in the case of the DHCP provided IP address since I did not see any default gw IP in the routing table?
> 2. With statically configured IP, if I explicitly configure a default GW, I can see packets are going out and receiving. I can see the default GW in the routing table. Do I need a default GW to send packets from a statically configured IP address ?
>
> Thank you for your time
>
> Regards
> Simon
>  
> _______________________________________________
> ISC funds the development of this software with paid support subscriptions. Contact us at https://www.isc.org/contact/ for more information.
>
> dhcp-users mailing list
> [hidden email]
> https://lists.isc.org/mailman/listinfo/dhcp-users

Peter Yardley
[hidden email]

_______________________________________________
ISC funds the development of this software with paid support subscriptions. Contact us at https://www.isc.org/contact/ for more information.

dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
Reply | Threaded
Open this post in threaded view
|

Re: Query on default gateway with DHCP vs Static address

SIMON BABY
Hi Peter,
Thank you so much for helping.

Yes, I am using ISC dhcpd. My query is with ISC DHCPd I can ping to any network, but I did not see the ISC gateway in the kernel route table. Will it be stored somewhere else so that when packet goes out, the hardware (NIC) gets this information?

Regards
Simon

On Thu, Mar 18, 2021 at 5:07 PM Peter Yardley <[hidden email]> wrote:
Hi,

This is prolly a problem with your configuration. Are you using ISC DHCPd? If so could provide a relevant snippet of your configuration, anonymised if necessary.

I used to configure subnets like this …

subnet 10.20.50.0 netmask 255.255.254.0 {
    option subnet-mask 255.255.254.0;
    option broadcast-address 10.20.51.255;
    option routers 10.20.50.1;

    pool {
        # A device for Blah
        host HMTXYZ           { hardware ethernet 00:40:9d:54:4c:c7;
                                        fixed-address 10.20.50.32; }
        …

        range 10.20.51.0 138.25.51.254;
    }

Of course there are many other correct possiblities


> On 19 Mar 2021, at 10:03 am, SIMON BABY <[hidden email]> wrote:
>
> Hi,
> I have a query about the DHCP provided IP address vs Static IP address configured manually.  When i get the IP address from DHCP, I can ping to 8.8.8.8 (google public server) where as
> with a statically configured IP address, I could not.  When I looked into the route table (route -n ), I did not see any default gateway with DHCP or Statically configured IP.  (I am testing with Linux).
>
> 1. Can I know when the packet goes out , how did the hardware (NIC) find the default gateway in the case of the DHCP provided IP address since I did not see any default gw IP in the routing table?
> 2. With statically configured IP, if I explicitly configure a default GW, I can see packets are going out and receiving. I can see the default GW in the routing table. Do I need a default GW to send packets from a statically configured IP address ?
>
> Thank you for your time
>
> Regards
> Simon

> _______________________________________________
> ISC funds the development of this software with paid support subscriptions. Contact us at https://www.isc.org/contact/ for more information.
>
> dhcp-users mailing list
> [hidden email]
> https://lists.isc.org/mailman/listinfo/dhcp-users

Peter Yardley
[hidden email]

_______________________________________________
ISC funds the development of this software with paid support subscriptions. Contact us at https://www.isc.org/contact/ for more information.

dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users

_______________________________________________
ISC funds the development of this software with paid support subscriptions. Contact us at https://www.isc.org/contact/ for more information.

dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
Reply | Threaded
Open this post in threaded view
|

Re: Query on default gateway with DHCP vs Static address

glenn.satchell
Hi Simon,

The default route will show up with a destination of 0.0.0.0/0 if you
use route -n.

If you use "ip route" it will show up with a destination of "default" in
the first column.

regards,
Glenn

On 2021-03-19 13:54, SIMON BABY wrote:

> Hi Peter,
> Thank you so much for helping.
>
> Yes, I am using ISC dhcpd. My query is with ISC DHCPd I can ping to
> any network, but I did not see the ISC gateway in the kernel route
> table. Will it be stored somewhere else so that when packet goes out,
> the hardware (NIC) gets this information?
>
> Regards
> Simon
>
> On Thu, Mar 18, 2021 at 5:07 PM Peter Yardley
> <[hidden email]> wrote:
>
>> Hi,
>>
>> This is prolly a problem with your configuration. Are you using ISC
>> DHCPd? If so could provide a relevant snippet of your configuration,
>> anonymised if necessary.
>>
>> I used to configure subnets like this …
>>
>> subnet 10.20.50.0 netmask 255.255.254.0 {
>> option subnet-mask 255.255.254.0;
>> option broadcast-address 10.20.51.255;
>> option routers 10.20.50.1;
>>
>> pool {
>> # A device for Blah
>> host HMTXYZ           { hardware ethernet 00:40:9d:54:4c:c7;
>> fixed-address 10.20.50.32; }
>> …
>>
>> range 10.20.51.0 138.25.51.254;
>> }
>>
>> Of course there are many other correct possiblities
>>
>>> On 19 Mar 2021, at 10:03 am, SIMON BABY <[hidden email]>
>> wrote:
>>>
>>> Hi,
>>> I have a query about the DHCP provided IP address vs Static IP
>> address configured manually.  When i get the IP address from DHCP, I
>> can ping to 8.8.8.8 (google public server) where as
>>> with a statically configured IP address, I could not.  When I
>> looked into the route table (route -n ), I did not see any default
>> gateway with DHCP or Statically configured IP.  (I am testing with
>> Linux).
>>>
>>> 1. Can I know when the packet goes out , how did the hardware
>> (NIC) find the default gateway in the case of the DHCP provided IP
>> address since I did not see any default gw IP in the routing table?
>>> 2. With statically configured IP, if I explicitly configure a
>> default GW, I can see packets are going out and receiving. I can see
>> the default GW in the routing table. Do I need a default GW to send
>> packets from a statically configured IP address ?
>>>
>>> Thank you for your time
>>>
>>> Regards
>>> Simon
>>>
>>> _______________________________________________
>>> ISC funds the development of this software with paid support
>> subscriptions. Contact us at https://www.isc.org/contact/ for more
>> information.
>>>
>>> dhcp-users mailing list
>>> [hidden email]
>>> https://lists.isc.org/mailman/listinfo/dhcp-users
>>
>> Peter Yardley
>> [hidden email]
>>
>> _______________________________________________
>> ISC funds the development of this software with paid support
>> subscriptions. Contact us at https://www.isc.org/contact/ for more
>> information.
>>
>> dhcp-users mailing list
>> [hidden email]
>> https://lists.isc.org/mailman/listinfo/dhcp-users
> _______________________________________________
> ISC funds the development of this software with paid support
> subscriptions. Contact us at https://www.isc.org/contact/ for more
> information.
>
> dhcp-users mailing list
> [hidden email]
> https://lists.isc.org/mailman/listinfo/dhcp-users
_______________________________________________
ISC funds the development of this software with paid support subscriptions. Contact us at https://www.isc.org/contact/ for more information.

dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
Reply | Threaded
Open this post in threaded view
|

Re: Query on default gateway with DHCP vs Static address

SIMON BABY
Hi Glenn,
It did not show the default route of 0.0.0.0/0 with route -n. One thing I noticed is, I can ping to another Address only with -I interface_name. For example I can send and receive packets with ping -I eth0 8.8.8.8. 
If I use ping 8.8.8.8 it is not working. Am I missing anything here?

Regards
Simon

On Thu, Mar 18, 2021 at 8:15 PM <[hidden email]> wrote:
Hi Simon,

The default route will show up with a destination of 0.0.0.0/0 if you
use route -n.

If you use "ip route" it will show up with a destination of "default" in
the first column.

regards,
Glenn

On 2021-03-19 13:54, SIMON BABY wrote:
> Hi Peter,
> Thank you so much for helping.
>
> Yes, I am using ISC dhcpd. My query is with ISC DHCPd I can ping to
> any network, but I did not see the ISC gateway in the kernel route
> table. Will it be stored somewhere else so that when packet goes out,
> the hardware (NIC) gets this information?
>
> Regards
> Simon
>
> On Thu, Mar 18, 2021 at 5:07 PM Peter Yardley
> <[hidden email]> wrote:
>
>> Hi,
>>
>> This is prolly a problem with your configuration. Are you using ISC
>> DHCPd? If so could provide a relevant snippet of your configuration,
>> anonymised if necessary.
>>
>> I used to configure subnets like this …
>>
>> subnet 10.20.50.0 netmask 255.255.254.0 {
>> option subnet-mask 255.255.254.0;
>> option broadcast-address 10.20.51.255;
>> option routers 10.20.50.1;
>>
>> pool {
>> # A device for Blah
>> host HMTXYZ           { hardware ethernet 00:40:9d:54:4c:c7;
>> fixed-address 10.20.50.32; }
>> …
>>
>> range 10.20.51.0 138.25.51.254;
>> }
>>
>> Of course there are many other correct possiblities
>>
>>> On 19 Mar 2021, at 10:03 am, SIMON BABY <[hidden email]>
>> wrote:
>>>
>>> Hi,
>>> I have a query about the DHCP provided IP address vs Static IP
>> address configured manually.  When i get the IP address from DHCP, I
>> can ping to 8.8.8.8 (google public server) where as
>>> with a statically configured IP address, I could not.  When I
>> looked into the route table (route -n ), I did not see any default
>> gateway with DHCP or Statically configured IP.  (I am testing with
>> Linux).
>>>
>>> 1. Can I know when the packet goes out , how did the hardware
>> (NIC) find the default gateway in the case of the DHCP provided IP
>> address since I did not see any default gw IP in the routing table?
>>> 2. With statically configured IP, if I explicitly configure a
>> default GW, I can see packets are going out and receiving. I can see
>> the default GW in the routing table. Do I need a default GW to send
>> packets from a statically configured IP address ?
>>>
>>> Thank you for your time
>>>
>>> Regards
>>> Simon
>>>
>>> _______________________________________________
>>> ISC funds the development of this software with paid support
>> subscriptions. Contact us at https://www.isc.org/contact/ for more
>> information.
>>>
>>> dhcp-users mailing list
>>> [hidden email]
>>> https://lists.isc.org/mailman/listinfo/dhcp-users
>>
>> Peter Yardley
>> [hidden email]
>>
>> _______________________________________________
>> ISC funds the development of this software with paid support
>> subscriptions. Contact us at https://www.isc.org/contact/ for more
>> information.
>>
>> dhcp-users mailing list
>> [hidden email]
>> https://lists.isc.org/mailman/listinfo/dhcp-users
> _______________________________________________
> ISC funds the development of this software with paid support
> subscriptions. Contact us at https://www.isc.org/contact/ for more
> information.
>
> dhcp-users mailing list
> [hidden email]
> https://lists.isc.org/mailman/listinfo/dhcp-users
_______________________________________________
ISC funds the development of this software with paid support subscriptions. Contact us at https://www.isc.org/contact/ for more information.

dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users

_______________________________________________
ISC funds the development of this software with paid support subscriptions. Contact us at https://www.isc.org/contact/ for more information.

dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
Reply | Threaded
Open this post in threaded view
|

Re: Query on default gateway with DHCP vs Static address

glenn.satchell
Hi Simon,

On your dhcp server do you specify a gateway? For isc dhcpd it will be
"option routers" in the subnet definition settings. Verify that the
gateway you specify is in the same subnet as the IP address being
assigned to the interface.

Can you post the output from "ip route" and "ip address" so we can see
what is there?

If you are configuring the IP address manually then it depends on your
particular version of linux on how that is done. Usually you will
specify an IP address, netmask and gateway- but the files used vary from
distribution to distribution. eg Ubuntu uses /etc/netplan/*yaml or
/etc/network/interfaces depending on the version. CentOS uses
/etc/sysconfig/network-scripts/ifcfg-eth0. Or it may use Network Manager
and the associated GUI to manage the configuration.

regards,
Glenn

On 2021-03-19 14:34, SIMON BABY wrote:

> Hi Glenn,
> It did not show the default route of 0.0.0.0/0 [1] with route -n. One
> thing I noticed is, I can ping to another Address only with -I
> interface_name. For example I can send and receive packets with ping
> -I eth0 8.8.8.8.
> If I use ping 8.8.8.8 it is not working. Am I missing anything here?
>
> Regards
> Simon
>
> On Thu, Mar 18, 2021 at 8:15 PM <[hidden email]> wrote:
>
>> Hi Simon,
>>
>> The default route will show up with a destination of 0.0.0.0/0 [1]
>> if you
>> use route -n.
>>
>> If you use "ip route" it will show up with a destination of
>> "default" in
>> the first column.
>>
>> regards,
>> Glenn
>>
>> On 2021-03-19 13:54, SIMON BABY wrote:
>>> Hi Peter,
>>> Thank you so much for helping.
>>>
>>> Yes, I am using ISC dhcpd. My query is with ISC DHCPd I can ping
>> to
>>> any network, but I did not see the ISC gateway in the kernel route
>>> table. Will it be stored somewhere else so that when packet goes
>> out,
>>> the hardware (NIC) gets this information?
>>>
>>> Regards
>>> Simon
>>>
>>> On Thu, Mar 18, 2021 at 5:07 PM Peter Yardley
>>> <[hidden email]> wrote:
>>>
>>>> Hi,
>>>>
>>>> This is prolly a problem with your configuration. Are you using
>> ISC
>>>> DHCPd? If so could provide a relevant snippet of your
>> configuration,
>>>> anonymised if necessary.
>>>>
>>>> I used to configure subnets like this …
>>>>
>>>> subnet 10.20.50.0 netmask 255.255.254.0 {
>>>> option subnet-mask 255.255.254.0;
>>>> option broadcast-address 10.20.51.255;
>>>> option routers 10.20.50.1;
>>>>
>>>> pool {
>>>> # A device for Blah
>>>> host HMTXYZ           { hardware ethernet 00:40:9d:54:4c:c7;
>>>> fixed-address 10.20.50.32; }
>>>> …
>>>>
>>>> range 10.20.51.0 138.25.51.254;
>>>> }
>>>>
>>>> Of course there are many other correct possiblities
>>>>
>>>>> On 19 Mar 2021, at 10:03 am, SIMON BABY <[hidden email]>
>>>> wrote:
>>>>>
>>>>> Hi,
>>>>> I have a query about the DHCP provided IP address vs Static IP
>>>> address configured manually.  When i get the IP address from
>> DHCP, I
>>>> can ping to 8.8.8.8 (google public server) where as
>>>>> with a statically configured IP address, I could not.  When I
>>>> looked into the route table (route -n ), I did not see any
>> default
>>>> gateway with DHCP or Statically configured IP.  (I am testing
>> with
>>>> Linux).
>>>>>
>>>>> 1. Can I know when the packet goes out , how did the hardware
>>>> (NIC) find the default gateway in the case of the DHCP provided
>> IP
>>>> address since I did not see any default gw IP in the routing
>> table?
>>>>> 2. With statically configured IP, if I explicitly configure a
>>>> default GW, I can see packets are going out and receiving. I can
>> see
>>>> the default GW in the routing table. Do I need a default GW to
>> send
>>>> packets from a statically configured IP address ?
>>>>>
>>>>> Thank you for your time
>>>>>
>>>>> Regards
>>>>> Simon
>>>>>
>>>>> _______________________________________________
>>>>> ISC funds the development of this software with paid support
>>>> subscriptions. Contact us at https://www.isc.org/contact/ for
>> more
>>>> information.
>>>>>
>>>>> dhcp-users mailing list
>>>>> [hidden email]
>>>>> https://lists.isc.org/mailman/listinfo/dhcp-users
>>>>
>>>> Peter Yardley
>>>> [hidden email]
>>>>
>>>> _______________________________________________
>>>> ISC funds the development of this software with paid support
>>>> subscriptions. Contact us at https://www.isc.org/contact/ for
>> more
>>>> information.
>>>>
>>>> dhcp-users mailing list
>>>> [hidden email]
>>>> https://lists.isc.org/mailman/listinfo/dhcp-users
>>> _______________________________________________
>>> ISC funds the development of this software with paid support
>>> subscriptions. Contact us at https://www.isc.org/contact/ for more
>>> information.
>>>
>>> dhcp-users mailing list
>>> [hidden email]
>>> https://lists.isc.org/mailman/listinfo/dhcp-users
>> _______________________________________________
>> ISC funds the development of this software with paid support
>> subscriptions. Contact us at https://www.isc.org/contact/ for more
>> information.
>>
>> dhcp-users mailing list
>> [hidden email]
>> https://lists.isc.org/mailman/listinfo/dhcp-users
>
>
> Links:
> ------
> [1] http://0.0.0.0/0
> _______________________________________________
> ISC funds the development of this software with paid support
> subscriptions. Contact us at https://www.isc.org/contact/ for more
> information.
>
> dhcp-users mailing list
> [hidden email]
> https://lists.isc.org/mailman/listinfo/dhcp-users
_______________________________________________
ISC funds the development of this software with paid support subscriptions. Contact us at https://www.isc.org/contact/ for more information.

dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
Reply | Threaded
Open this post in threaded view
|

Re: Query on default gateway with DHCP vs Static address

SIMON BABY
Hi Glenn,
My linux interface is a DHCP client which is connected to a night hawk (cradlepoint) which acts as the DHCP server. So my Linux interface is getting a DHCP IP address as gievn below

eth1.15   Link encap:Ethernet  HWaddr 00:08:A2:00:00:02

          inet addr:192.168.1.76  Bcast:192.168.1.255  Mask:255.255.255.0

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:457 errors:0 dropped:0 overruns:0 frame:0

          TX packets:1782 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0

          RX bytes:44717 (43.6 KiB)  TX bytes:1704498 (1.6 MiB)



The kernel routing table is below. I did not see any default GW in the routing table.


Kernel IP routing table

Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface

10.64.64.67     0.0.0.0         255.255.255.255 UH        0 0          0 ppp3

10.64.64.66     0.0.0.0         255.255.255.255 UH        0 0          0 ppp2

10.64.64.65     0.0.0.0         255.255.255.255 UH        0 0          0 ppp1

255.255.255.255 0.0.0.0         255.255.255.255 UH        0 0          0 eth1.13

192.168.1.0     0.0.0.0         255.255.255.0   U         0 0          0 eth1.15

128.0.0.0       0.0.0.0         255.255.255.0   U         0 0          0 eth1.16

128.1.0.0       0.0.0.0         255.255.0.0     U         0 0          0 eth0

10.20.0.0       0.0.0.0         255.255.0.0     U         0 0          0 eth1.13


Regards

Simon





 


On Thu, Mar 18, 2021 at 8:48 PM <[hidden email]> wrote:
Hi Simon,

On your dhcp server do you specify a gateway? For isc dhcpd it will be
"option routers" in the subnet definition settings. Verify that the
gateway you specify is in the same subnet as the IP address being
assigned to the interface.

Can you post the output from "ip route" and "ip address" so we can see
what is there?

If you are configuring the IP address manually then it depends on your
particular version of linux on how that is done. Usually you will
specify an IP address, netmask and gateway- but the files used vary from
distribution to distribution. eg Ubuntu uses /etc/netplan/*yaml or
/etc/network/interfaces depending on the version. CentOS uses
/etc/sysconfig/network-scripts/ifcfg-eth0. Or it may use Network Manager
and the associated GUI to manage the configuration.

regards,
Glenn

On 2021-03-19 14:34, SIMON BABY wrote:
> Hi Glenn,
> It did not show the default route of 0.0.0.0/0 [1] with route -n. One
> thing I noticed is, I can ping to another Address only with -I
> interface_name. For example I can send and receive packets with ping
> -I eth0 8.8.8.8.
> If I use ping 8.8.8.8 it is not working. Am I missing anything here?
>
> Regards
> Simon
>
> On Thu, Mar 18, 2021 at 8:15 PM <[hidden email]> wrote:
>
>> Hi Simon,
>>
>> The default route will show up with a destination of 0.0.0.0/0 [1]
>> if you
>> use route -n.
>>
>> If you use "ip route" it will show up with a destination of
>> "default" in
>> the first column.
>>
>> regards,
>> Glenn
>>
>> On 2021-03-19 13:54, SIMON BABY wrote:
>>> Hi Peter,
>>> Thank you so much for helping.
>>>
>>> Yes, I am using ISC dhcpd. My query is with ISC DHCPd I can ping
>> to
>>> any network, but I did not see the ISC gateway in the kernel route
>>> table. Will it be stored somewhere else so that when packet goes
>> out,
>>> the hardware (NIC) gets this information?
>>>
>>> Regards
>>> Simon
>>>
>>> On Thu, Mar 18, 2021 at 5:07 PM Peter Yardley
>>> <[hidden email]> wrote:
>>>
>>>> Hi,
>>>>
>>>> This is prolly a problem with your configuration. Are you using
>> ISC
>>>> DHCPd? If so could provide a relevant snippet of your
>> configuration,
>>>> anonymised if necessary.
>>>>
>>>> I used to configure subnets like this …
>>>>
>>>> subnet 10.20.50.0 netmask 255.255.254.0 {
>>>> option subnet-mask 255.255.254.0;
>>>> option broadcast-address 10.20.51.255;
>>>> option routers 10.20.50.1;
>>>>
>>>> pool {
>>>> # A device for Blah
>>>> host HMTXYZ           { hardware ethernet 00:40:9d:54:4c:c7;
>>>> fixed-address 10.20.50.32; }
>>>> …
>>>>
>>>> range 10.20.51.0 138.25.51.254;
>>>> }
>>>>
>>>> Of course there are many other correct possiblities
>>>>
>>>>> On 19 Mar 2021, at 10:03 am, SIMON BABY <[hidden email]>
>>>> wrote:
>>>>>
>>>>> Hi,
>>>>> I have a query about the DHCP provided IP address vs Static IP
>>>> address configured manually.  When i get the IP address from
>> DHCP, I
>>>> can ping to 8.8.8.8 (google public server) where as
>>>>> with a statically configured IP address, I could not.  When I
>>>> looked into the route table (route -n ), I did not see any
>> default
>>>> gateway with DHCP or Statically configured IP.  (I am testing
>> with
>>>> Linux).
>>>>>
>>>>> 1. Can I know when the packet goes out , how did the hardware
>>>> (NIC) find the default gateway in the case of the DHCP provided
>> IP
>>>> address since I did not see any default gw IP in the routing
>> table?
>>>>> 2. With statically configured IP, if I explicitly configure a
>>>> default GW, I can see packets are going out and receiving. I can
>> see
>>>> the default GW in the routing table. Do I need a default GW to
>> send
>>>> packets from a statically configured IP address ?
>>>>>
>>>>> Thank you for your time
>>>>>
>>>>> Regards
>>>>> Simon
>>>>>
>>>>> _______________________________________________
>>>>> ISC funds the development of this software with paid support
>>>> subscriptions. Contact us at https://www.isc.org/contact/ for
>> more
>>>> information.
>>>>>
>>>>> dhcp-users mailing list
>>>>> [hidden email]
>>>>> https://lists.isc.org/mailman/listinfo/dhcp-users
>>>>
>>>> Peter Yardley
>>>> [hidden email]
>>>>
>>>> _______________________________________________
>>>> ISC funds the development of this software with paid support
>>>> subscriptions. Contact us at https://www.isc.org/contact/ for
>> more
>>>> information.
>>>>
>>>> dhcp-users mailing list
>>>> [hidden email]
>>>> https://lists.isc.org/mailman/listinfo/dhcp-users
>>> _______________________________________________
>>> ISC funds the development of this software with paid support
>>> subscriptions. Contact us at https://www.isc.org/contact/ for more
>>> information.
>>>
>>> dhcp-users mailing list
>>> [hidden email]
>>> https://lists.isc.org/mailman/listinfo/dhcp-users
>> _______________________________________________
>> ISC funds the development of this software with paid support
>> subscriptions. Contact us at https://www.isc.org/contact/ for more
>> information.
>>
>> dhcp-users mailing list
>> [hidden email]
>> https://lists.isc.org/mailman/listinfo/dhcp-users
>
>
> Links:
> ------
> [1] http://0.0.0.0/0
> _______________________________________________
> ISC funds the development of this software with paid support
> subscriptions. Contact us at https://www.isc.org/contact/ for more
> information.
>
> dhcp-users mailing list
> [hidden email]
> https://lists.isc.org/mailman/listinfo/dhcp-users
_______________________________________________
ISC funds the development of this software with paid support subscriptions. Contact us at https://www.isc.org/contact/ for more information.

dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users

_______________________________________________
ISC funds the development of this software with paid support subscriptions. Contact us at https://www.isc.org/contact/ for more information.

dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
Reply | Threaded
Open this post in threaded view
|

Re: Query on default gateway with DHCP vs Static address

glenn.satchell
HI SImon,

Ok that's clearer now - it's the ISC client you use, but an entirely
different DHCP server.

Probably you need to do some packet captures using,say, tcpdump to look
at the actual packets being sent from the dhcp server and the specific
dhcp options being sent.

Also, have a look in the dhclient.conf  (location varies with different
Linux distros, eg Ubuntu is /etc/dhcp/dhclient.conf) and seewhat options
itis requesting. eg on Ubuntu in that file I have

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

send host-name = gethostname();
request subnet-mask, broadcast-address, time-offset, routers,
         domain-name, domain-name-servers, domain-search, host-name,
         dhcp6.name-servers, dhcp6.domain-search, dhcp6.fqdn,
dhcp6.sntp-servers,
         netbios-name-servers, netbios-scope, interface-mtu,
         rfc3442-classless-static-routes, ntp-servers;

"routers" asks the dhcp server to send the default gateway info.

regards,
Glenn

On 2021-03-19 16:10, SIMON BABY wrote:

> Hi Glenn,
> My linux interface is a DHCP client which is connected to a night hawk
> (cradlepoint) which acts as the DHCP server. So my Linux interface is
> getting a DHCP IP address as gievn below
>
> eth1.15   Link encap:Ethernet  HWaddr 00:08:A2:00:00:02
>
>           inet addr:192.168.1.76  Bcast:192.168.1.255
> Mask:255.255.255.0
>
>           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>
>           RX packets:457 errors:0 dropped:0 overruns:0 frame:0
>
>           TX packets:1782 errors:0 dropped:0 overruns:0 carrier:0
>
>           collisions:0 txqueuelen:0
>
>           RX bytes:44717 (43.6 KiB)  TX bytes:1704498 (1.6 MiB)
>
> The kernel routing table is below. I did not see any default GW in the
> routing table.
>
> Kernel IP routing table
>
> Destination     Gateway         Genmask         Flags   MSS Window
> irtt Iface
>
> 10.64.64.67     0.0.0.0         255.255.255.255 UH        0 0
> 0 ppp3
>
> 10.64.64.66     0.0.0.0         255.255.255.255 UH        0 0
> 0 ppp2
>
> 10.64.64.65     0.0.0.0         255.255.255.255 UH        0 0
> 0 ppp1
>
> 255.255.255.255 0.0.0.0         255.255.255.255 UH        0 0
> 0 eth1.13
>
> 192.168.1.0     0.0.0.0         255.255.255.0   U         0 0
> 0 eth1.15
>
> 128.0.0.0       0.0.0.0         255.255.255.0   U         0 0
> 0 eth1.16
>
> 128.1.0.0       0.0.0.0         255.255.0.0     U         0 0
> 0 eth0
>
> 10.20.0.0       0.0.0.0         255.255.0.0     U         0 0
> 0 eth1.13
>
> Regards
>
> Simon
>
> On Thu, Mar 18, 2021 at 8:48 PM <[hidden email]> wrote:
>
>> Hi Simon,
>>
>> On your dhcp server do you specify a gateway? For isc dhcpd it will
>> be
>> "option routers" in the subnet definition settings. Verify that the
>> gateway you specify is in the same subnet as the IP address being
>> assigned to the interface.
>>
>> Can you post the output from "ip route" and "ip address" so we can
>> see
>> what is there?
>>
>> If you are configuring the IP address manually then it depends on
>> your
>> particular version of linux on how that is done. Usually you will
>> specify an IP address, netmask and gateway- but the files used vary
>> from
>> distribution to distribution. eg Ubuntu uses /etc/netplan/*yaml or
>> /etc/network/interfaces depending on the version. CentOS uses
>> /etc/sysconfig/network-scripts/ifcfg-eth0. Or it may use Network
>> Manager
>> and the associated GUI to manage the configuration.
>>
>> regards,
>> Glenn
>>
>> On 2021-03-19 14:34, SIMON BABY wrote:
>>> Hi Glenn,
>>> It did not show the default route of 0.0.0.0/0 [1] [1] with route
>> -n. One
>>> thing I noticed is, I can ping to another Address only with -I
>>> interface_name. For example I can send and receive packets with
>> ping
>>> -I eth0 8.8.8.8.
>>> If I use ping 8.8.8.8 it is not working. Am I missing anything
>> here?
>>>
>>> Regards
>>> Simon
>>>
>>> On Thu, Mar 18, 2021 at 8:15 PM <[hidden email]>
>> wrote:
>>>
>>>> Hi Simon,
>>>>
>>>> The default route will show up with a destination of 0.0.0.0/0
>> [1] [1]
>>>> if you
>>>> use route -n.
>>>>
>>>> If you use "ip route" it will show up with a destination of
>>>> "default" in
>>>> the first column.
>>>>
>>>> regards,
>>>> Glenn
>>>>
>>>> On 2021-03-19 13:54, SIMON BABY wrote:
>>>>> Hi Peter,
>>>>> Thank you so much for helping.
>>>>>
>>>>> Yes, I am using ISC dhcpd. My query is with ISC DHCPd I can ping
>>>> to
>>>>> any network, but I did not see the ISC gateway in the kernel
>> route
>>>>> table. Will it be stored somewhere else so that when packet goes
>>>> out,
>>>>> the hardware (NIC) gets this information?
>>>>>
>>>>> Regards
>>>>> Simon
>>>>>
>>>>> On Thu, Mar 18, 2021 at 5:07 PM Peter Yardley
>>>>> <[hidden email]> wrote:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> This is prolly a problem with your configuration. Are you using
>>>> ISC
>>>>>> DHCPd? If so could provide a relevant snippet of your
>>>> configuration,
>>>>>> anonymised if necessary.
>>>>>>
>>>>>> I used to configure subnets like this …
>>>>>>
>>>>>> subnet 10.20.50.0 netmask 255.255.254.0 {
>>>>>> option subnet-mask 255.255.254.0;
>>>>>> option broadcast-address 10.20.51.255;
>>>>>> option routers 10.20.50.1;
>>>>>>
>>>>>> pool {
>>>>>> # A device for Blah
>>>>>> host HMTXYZ           { hardware ethernet 00:40:9d:54:4c:c7;
>>>>>> fixed-address 10.20.50.32; }
>>>>>> …
>>>>>>
>>>>>> range 10.20.51.0 138.25.51.254;
>>>>>> }
>>>>>>
>>>>>> Of course there are many other correct possiblities
>>>>>>
>>>>>>> On 19 Mar 2021, at 10:03 am, SIMON BABY <[hidden email]>
>>>>>> wrote:
>>>>>>>
>>>>>>> Hi,
>>>>>>> I have a query about the DHCP provided IP address vs Static IP
>>>>>> address configured manually.  When i get the IP address from
>>>> DHCP, I
>>>>>> can ping to 8.8.8.8 (google public server) where as
>>>>>>> with a statically configured IP address, I could not.  When I
>>>>>> looked into the route table (route -n ), I did not see any
>>>> default
>>>>>> gateway with DHCP or Statically configured IP.  (I am testing
>>>> with
>>>>>> Linux).
>>>>>>>
>>>>>>> 1. Can I know when the packet goes out , how did the hardware
>>>>>> (NIC) find the default gateway in the case of the DHCP provided
>>>> IP
>>>>>> address since I did not see any default gw IP in the routing
>>>> table?
>>>>>>> 2. With statically configured IP, if I explicitly configure a
>>>>>> default GW, I can see packets are going out and receiving. I
>> can
>>>> see
>>>>>> the default GW in the routing table. Do I need a default GW to
>>>> send
>>>>>> packets from a statically configured IP address ?
>>>>>>>
>>>>>>> Thank you for your time
>>>>>>>
>>>>>>> Regards
>>>>>>> Simon
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> ISC funds the development of this software with paid support
>>>>>> subscriptions. Contact us at https://www.isc.org/contact/ for
>>>> more
>>>>>> information.
>>>>>>>
>>>>>>> dhcp-users mailing list
>>>>>>> [hidden email]
>>>>>>> https://lists.isc.org/mailman/listinfo/dhcp-users
>>>>>>
>>>>>> Peter Yardley
>>>>>> [hidden email]
>>>>>>
>>>>>> _______________________________________________
>>>>>> ISC funds the development of this software with paid support
>>>>>> subscriptions. Contact us at https://www.isc.org/contact/ for
>>>> more
>>>>>> information.
>>>>>>
>>>>>> dhcp-users mailing list
>>>>>> [hidden email]
>>>>>> https://lists.isc.org/mailman/listinfo/dhcp-users
>>>>> _______________________________________________
>>>>> ISC funds the development of this software with paid support
>>>>> subscriptions. Contact us at https://www.isc.org/contact/ for
>> more
>>>>> information.
>>>>>
>>>>> dhcp-users mailing list
>>>>> [hidden email]
>>>>> https://lists.isc.org/mailman/listinfo/dhcp-users
>>>> _______________________________________________
>>>> ISC funds the development of this software with paid support
>>>> subscriptions. Contact us at https://www.isc.org/contact/ for
>> more
>>>> information.
>>>>
>>>> dhcp-users mailing list
>>>> [hidden email]
>>>> https://lists.isc.org/mailman/listinfo/dhcp-users
>>>
>>>
>>> Links:
>>> ------
>>> [1] http://0.0.0.0/0
>>> _______________________________________________
>>> ISC funds the development of this software with paid support
>>> subscriptions. Contact us at https://www.isc.org/contact/ for more
>>> information.
>>>
>>> dhcp-users mailing list
>>> [hidden email]
>>> https://lists.isc.org/mailman/listinfo/dhcp-users
>> _______________________________________________
>> ISC funds the development of this software with paid support
>> subscriptions. Contact us at https://www.isc.org/contact/ for more
>> information.
>>
>> dhcp-users mailing list
>> [hidden email]
>> https://lists.isc.org/mailman/listinfo/dhcp-users
>
>
> Links:
> ------
> [1] http://0.0.0.0/0
> _______________________________________________
> ISC funds the development of this software with paid support
> subscriptions. Contact us at https://www.isc.org/contact/ for more
> information.
>
> dhcp-users mailing list
> [hidden email]
> https://lists.isc.org/mailman/listinfo/dhcp-users
_______________________________________________
ISC funds the development of this software with paid support subscriptions. Contact us at https://www.isc.org/contact/ for more information.

dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
Reply | Threaded
Open this post in threaded view
|

Re: Host declarations are GLOBAL (was: Query on default gateway with DHCP vs Static address)

Simon Hobson
In reply to this post by Peter Yardley-2
Peter Yardley <[hidden email]> wrote:

> I used to configure subnets like this …
>
> subnet 10.20.50.0 netmask 255.255.254.0 {
>    option subnet-mask 255.255.254.0;
>    option broadcast-address 10.20.51.255;
>    option routers 10.20.50.1;
>
>    pool {
>        # A device for Blah
>        host HMTXYZ           { hardware ethernet 00:40:9d:54:4c:c7;
>                                        fixed-address 10.20.50.32; }
>        …
>
>        range 10.20.51.0 138.25.51.254;
>    }

For the benefit of anyone finding this thread later ...


DO NOT put host statements in anything other than the global scope (or a group that is within the global scope). Especially, do not put them inside a subnet declaration.

Yes, that is a **DO NOT**

Why ? They are treated as global in scope by the server, but inherit properties from where they are defined. What this means is that you can declare a host within one subnet, but that declaration is valid if the device moves to another network. So the device could get an address in the network to which it is attached, but inherit options from where it is defined. Since these inherited options include the router - which will not be valid on any other network - this is highly unlikely to be what you want. I'm sure there may be some esoteric configuration where that's useful, but AFAIK no-one has every come up with one on this list.
I think you might be able to imagine how "interesting" it would be to debug why a client is getting a router that's not in it's own subnet :D

So just don't do it<period>


Of course, with a single network and single subnet, this problem will be masked. But then you add another network, move some clients, and chaos ensues.


Simon
_______________________________________________
ISC funds the development of this software with paid support subscriptions. Contact us at https://www.isc.org/contact/ for more information.

dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
Reply | Threaded
Open this post in threaded view
|

Re: Host declarations are GLOBAL (was: Query on default gateway with DHCP vs Static address)

Sten Carlsen




> On 19 Mar 2021, at 19.42, Simon Hobson <[hidden email]> wrote:
>
> Peter Yardley <[hidden email]> wrote:
>
>> I used to configure subnets like this …
>>
>> subnet 10.20.50.0 netmask 255.255.254.0 {
>>   option subnet-mask 255.255.254.0;
>>   option broadcast-address 10.20.51.255;
>>   option routers 10.20.50.1;
>>
>>   pool {
>>       # A device for Blah
>>       host HMTXYZ           { hardware ethernet 00:40:9d:54:4c:c7;
>>                                       fixed-address 10.20.50.32; }
>>       …
>>
>>       range 10.20.51.0 138.25.51.254;
>>   }
>
> For the benefit of anyone finding this thread later ...
>
>
> DO NOT put host statements in anything other than the global scope (or a group that is within the global scope). Especially, do not put them inside a subnet declaration.
>
> Yes, that is a **DO NOT**
>
> Why ? They are treated as global in scope by the server, but inherit properties from where they are defined. What this means is that you can declare a host within one subnet, but that declaration is valid if the device moves to another network. So the device could get an address in the network to which it is attached, but inherit options from where it is defined. Since these inherited options include the router - which will not be valid on any other network - this is highly unlikely to be what you want. I'm sure there may be some esoteric configuration where that's useful, but AFAIK no-one has every come up with one on this list.
> I think you might be able to imagine how "interesting" it would be to debug why a client is getting a router that's not in it's own subnet :D
>
> So just don't do it<period>

I could not agree more with Simon - There seems to be one other problem here - the Fixed address lies in what seems to be the address range for the pool. That is a NO-GO. The server will happily hand out the Fixed address to another host. Always put Fixed addresses outside any pool range - this is different from some other servers but will (has already) cause some "interesting" debug scenarios.

>
>
> Of course, with a single network and single subnet, this problem will be masked. But then you add another network, move some clients, and chaos ensues.
>
>
> Simon
> _______________________________________________
> ISC funds the development of this software with paid support subscriptions. Contact us at https://www.isc.org/contact/ for more information.
>
> dhcp-users mailing list
> [hidden email]
> https://lists.isc.org/mailman/listinfo/dhcp-users

_______________________________________________
ISC funds the development of this software with paid support subscriptions. Contact us at https://www.isc.org/contact/ for more information.

dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users