Page 3 of 4 FirstFirst 1234 LastLast
Results 21 to 30 of 31

Thread: DHCP on specific IP address range

  1. #21
    Administrator Site Admin-
    Join Date
    Apr 2003
    Location
    USA
    Posts
    5,441
    Chip, I know nothing about the route command, but 0.0.0.0 is never a valid netmask. Do a little reading about netmask on Google for details.
    ---
    Verifying of md5 checksum and burning a CD at slow speed are important.

  2. #22
    Senior Member registered user
    Join Date
    Feb 2006
    Location
    Canada
    Posts
    204
    Quote Originally Posted by Harry Kuhman
    One problem that I see right away here is that the netmask should not be 0.0.0.0.
    I don't know about the route command, I generally just use netcardconfig and then anser the dhcp question "no". but try a netmask of 255.255.255.0 and see if that helps, otherwise try netcardconfig.
    Harry, no netmask 255.255.255.0 is not working. It has to be 0.0.0.0 in order to make it work. I post my whole test steps below.

    1. Boot knoppix 4.0.2 cd with cheat code: knoppix nodhcp
    2. Open a console session
    3. $sudo ifconfig eth0 192.168.1.90
    4. $sudo route add -net gw 192.168.1.1 netmask 255.255.255.0 dev eth0
    5. $sudo vi /etc/resolv.conf
    (add the line: nameserver 192.168.1.1 and then save the file)
    6. Try to go to www.yahoo.com (fails)
    7. $sudo route add -net gw 192.168.1.1 netmask 0.0.0.0 dev eth0
    8. $sudo route del -net gw 192.168.1.1 netmask 255.255.255.0 dev eth0
    9. Now use the browser to go to www.yahoo.com (success)

    Rgds,
    Chip

  3. #23
    Administrator Site Admin-
    Join Date
    Apr 2003
    Location
    USA
    Posts
    5,441
    Quote Originally Posted by chip.ling
    Harry, no netmask 255.255.255.0 is not working. It has to be 0.0.0.0 in order to make it work.....
    Chip, something very very strange is going on here. I urge you to look up what netmask does. 0.0.0.0. is never a valid netmask, but if it was it would tell the router to never send traffic off the local lan. If you have any Windows systems on that network I suggest that you check their netmasks with ipconfig (open a DOS shell). Of course, we know that your router is already doing something strange, but this mask should break many things.
    ---
    Verifying of md5 checksum and burning a CD at slow speed are important.

  4. #24
    Senior Member registered user
    Join Date
    Feb 2006
    Location
    Canada
    Posts
    204
    Quote Originally Posted by Harry Kuhman
    Chip, something very very strange is going on here. I urge you to look up what netmask does. 0.0.0.0. is never a valid netmask, but if it was it would tell the router to never send traffic off the local lan. If you have any Windows systems on that network I suggest that you check their netmasks with ipconfig (open a DOS shell). Of course, we know that your router is already doing something strange, but this mask should break many things.
    Harry,

    I think the netmask value here is for the gateway you try to reach to the outside world and if you set the value to 255.255.255.0, it will limit your address to your local network only. In my case, I want my machine being able to access all possible address on the internet so 0.0.0.0 make sense to me.

    Please do a testing on your end by boot up a knoppix cd with DHCP mode on and after it boots up. Type the route command on the console and see if your result is same as mine.

    Rgds,
    Chip

  5. #25
    Administrator Site Admin-
    Join Date
    Apr 2003
    Location
    USA
    Posts
    5,441
    Quote Originally Posted by chip.ling
    I think the netmask value here is for the gateway you try to reach to the outside world and if you set the value to 255.255.255.0, it will limit your address to your local network only. In my case, I want my machine being able to access all possible address on the internet so 0.0.0.0 make sense to me.
    As I said, I don't use the route command, so I'll want to do some reading and testing with it when I next get a chance. But all of my experience is that 0.0.0.0 is always a bad netmask. As to reaching the outside world, you local system should use the IP address that you are trying to reach and the netmask to determine if the gateway should be used or not. A netmask of 0.0.0.0 indicates that the address is always on the local LAN and so a gateway would never be used. I'm guessing that your somewhat unusual router is likely seeing the IP address as it comes into the switch and knows that it needs to be routed to the WAN port anyway, but things might break for you if your network grows to include additional switches unless this netmask issue is resolved. You may also have some problems the broadcast address and with Address Resolution Protocol with that netmask. And, in fact, this very well could give a clue as to why the same IP address is being handed out more than once! If ARP is broken due to a bad netmask then the routers tables may never be updated to reflect that the IP address is in use and not available for further use (although that still leaves a lot to be explained, like how it manages to route your traffic back to you).

    Quote Originally Posted by chip.ling
    Please do a testing on your end by boot up a knoppix cd with DHCP mode on and after it boots up. Type the route command on the console and see if your result is same as mine.
    I will look at both the route command and it's man page when I have time, although to be honest I haven't even booted Knoppix lately. Again I would ask that you also take a little time and look up netmask on Google and see if you can find me any references that explain validly using 0.0.0.0 as a netmask.

    You might also want to use ethereal to sniff the network connection and see the ARP traffic that goes on every couple of minutes to see if your system is actually receiving and responding properly to ARP packets. I don't see how it could be with that netmask, since it would not recognize a broadcast as a broadcast, but would think it was a packet intended for someone else.

  6. #26
    Senior Member registered user
    Join Date
    Feb 2006
    Location
    Canada
    Posts
    204
    Quote Originally Posted by Harry Kuhman
    As I said, I don't use the route command, so I'll want to do some reading and testing with it when I next get a chance.
    Neither do I. I just do a wild guess.

    Quote Originally Posted by Harry Kuhman
    I will look at both the route command and it's man page when I have time, although to be honest I haven't even booted Knoppix lately.
    I think if you already have a knoppix machine up and running, you don't really need to do a reboot. Just open a console and type "route", it will show what your gateway netmask value.

    Rgds,
    Chip

  7. #27
    Administrator Site Admin-
    Join Date
    Apr 2003
    Location
    USA
    Posts
    5,441
    Chip, I'm posting this from Debian so that I can cut and paste some info. I'm not using Knoppix, as I said I have not run Knoppix recently, but I believe that Knoppix and Debian will have the same results here. I am connecting by DHCP to a Dlink router.

    I have never had any occasion to use route and am not clear why you are using it either. When I get my DHCP setup I get a netmask and other settings from the router. That info can be seen by looking at the output of ifconfig (only the portion that deals with eth0 is shown here):
    Code:
    k6:/home/harry# ifconfig
    eth0      Link encap:Ethernet  HWaddr 00:A0:CC:E8:48:D3
              inet addr:192.168.0.103  Bcast:192.168.0.255  Mask:255.255.255.0
              inet6 addr: fe80::2a0:ccff:fee8:48d3/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:6525 errors:0 dropped:0 overruns:0 frame:0
              TX packets:2751 errors:1 dropped:0 overruns:0 carrier:2
              collisions:0 txqueuelen:1000
              RX bytes:7402966 (7.0 MiB)  TX bytes:191431 (186.9 KiB)
              Interrupt:10 Base address:0xe800
    Note that the netmask is what it should be for a normal private network using a 192.168 address and having at most 254 users (253 and the router).

    Note also that my router is handing out addresses in the 192.168.0.x range while yours is handing out addresses in the 192.168.1.x range. This is normal and I have even seen some routers that default to the 192.168.2.x range and you likely can set this to any third number that you want in your router setup. It is not a problem that we have different numbers here.

    I read through the man documentation for route. I see there plenty of example with a netmask, but none that use a netmask of 0.0.0.0.

    I couldn't see anything in the man pages to just get route to show me information, so I just tried the command route with no other input. It outputted this:
    Code:
    k6:/home/harry# route
    Kernel IP routing table
    Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
    192.168.0.0     *               255.255.255.0   U     0      0        0 eth0
    default         192.168.0.1     0.0.0.0         UG    0      0        0 eth0
    Note that there indeed is a 0.0.0.0 in this output, but it is called a genmask, not a netmask. If you Google the term genmask you will quickly find that the routing tables is using this as a mask differently than a normal netmask and that 0.0.0.0 is simply the general case default that the routing table uses if nothing more specific matches. So I guess this is why it is working for you, but I have no idea why you need to use the route command at all. I and most other people here using routers do not need to.

  8. #28
    Senior Member registered user
    Join Date
    Feb 2006
    Location
    Canada
    Posts
    204
    Quote Originally Posted by Harry Kuhman
    I have never had any occasion to use route and am not clear why you are using it either. When I get my DHCP setup I get a netmask and other settings from the router.
    I try to use static IP address for my Knoppix server instead of DHCP assign IP address to it. So I boot the knoppix with the cheat code: knoppix nodhcp

    After the boot up, only the "lo" is set up with a value. The eth0 is not defined. No gateway defined.

    I need to use the "ifconfig eth0 192.168.1.90" to set up the static IP address.

    Then use the "route add -net default gw 192.168.1.1 netmask 0.0.0.0 dev eth0" to set up the default gateway to 192.168.1.1 and Genmask to 0.0.0.0 for device eth0.

    The last step is to add an entry "nameserver 192.168.1.1" to the /etc/resolv.conf file, it is to define the DNS service.

    Basically, it is a step by step setup the knoppix server address manually.

    Quote Originally Posted by Harry Kuhman
    Code:
    k6:/home/harry# route
    Kernel IP routing table
    Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
    192.168.0.0     *               255.255.255.0   U     0      0        0 eth0
    default         192.168.0.1     0.0.0.0         UG    0      0        0 eth0
    Note that there indeed is a 0.0.0.0 in this output, but it is called a genmask, not a netmask. If you Google the term genmask you will quickly find that the routing tables is using this as a mask differently than a normal netmask and that 0.0.0.0 is simply the general case default that the routing table uses if nothing more specific matches. So I guess this is why it is working for you, but I have no idea why you need to use the route command at all. I and most other people here using routers do not need to.
    Yes, you are right. I double check on my "route" output. It is identical to yours. It shows Genmask instead of netmask.

    But I think the confusion here is the "route" command itself, "netmask 0.0.0.0" in fact setup the genmask value and is not really a netmask setup.

    Rgds,
    Chip

  9. #29
    Administrator Site Admin-
    Join Date
    Apr 2003
    Location
    USA
    Posts
    5,441
    Quote Originally Posted by chip.ling
    I try to use static IP address for my Knoppix server instead of DHCP assign IP address to it. So I boot the knoppix with the cheat code: knoppix nodhcp

    After the boot up, only the "lo" is set up with a value. The eth0 is not defined. No gateway defined.

    I need to use the "ifconfig eth0 192.168.1.90" to set up the static IP address.

    Then use the "route add ...
    Actually, I had thought that by doing static IP addresses on the other systems you were now able to use DHCP with Knoppix. But OK, lets assume that you want to boot with knoppix nodhcp for any reason.... After booting try this: run netcardconfig, either from the menu or from a shell. Say no to the first DHCP question (assuming that you still don't want to do a dhcp setup). Then answer the remaining questions, using 255.255.255.0 when asked for a netmask.

    After doing the above your ethernet connection should work, and it should be cleaner than using ifconfig and then route. No need for multiple commands (although you can use ifconfig after that if you just want to see the setings, but it is not needed).

  10. #30
    Senior Member registered user
    Join Date
    Feb 2006
    Location
    Canada
    Posts
    204
    Quote Originally Posted by Harry Kuhman
    Actually, I had thought that by doing static IP addresses on the other systems you were now able to use DHCP with Knoppix.
    I think I might run the Linux box as a server in the future that's why I try to use static addressing.

    Quote Originally Posted by Harry Kuhman
    But OK, lets assume that you want to boot with knoppix nodhcp for any reason.... After booting try this: run netcardconfig, either from the menu or from a shell. Say no to the first DHCP question (assuming that you still don't want to do a dhcp setup). Then answer the remaining questions, using 255.255.255.0 when asked for a netmask.
    Yes, netcardconfig should work fine. But I try to avoid using the interactive command if possible. I think I might put all the setup commands in a script in the future to automate the process. I don't know much about the syntax of netcardconfig command, can I input all the parameters on the command line instead of the interactive mode?

    I think one of the confusion here is that I don't use the full syntax of the ifconfig command in my case, I just go for the short cut and let the ifconfig command picks the default value of netmask, which is 255.255.255.0. But I can always use the full syntax of it like:
    ifconfig eth0 192.168.1.90 netmask 255.255.255.0 broadcast 192.168.1.255

    Quote Originally Posted by Harry Kuhman
    After doing the above your ethernet connection should work, and it should be cleaner than using ifconfig and then route. No need for multiple commands (although you can use ifconfig after that if you just want to see the setings, but it is not needed).
    Well, I agree on your point that it is easier to use the netcardconfig. But I think the multiple steps I'm using help me to know more about what the what actually happening under the hood.

    Rgds,
    Chip

Page 3 of 4 FirstFirst 1234 LastLast

Similar Threads

  1. How do I renew my DHCP address?
    By skrall in forum Networking
    Replies: 4
    Last Post: 05-13-2006, 05:15 AM
  2. Replies: 16
    Last Post: 06-02-2005, 07:46 PM
  3. network card boot-up problem, doesn't get dhcp address
    By J0hnP1pe in forum Hdd Install / Debian / Apt
    Replies: 3
    Last Post: 04-22-2005, 08:08 AM
  4. Can't pull an IP address via DHCP
    By bertocci in forum Networking
    Replies: 4
    Last Post: 03-10-2004, 09:12 PM
  5. Deny SMTP traffic from a specific IP Address
    By wooac in forum Networking
    Replies: 0
    Last Post: 02-24-2004, 12:39 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Dell PowerEdge R720 Server - 2x8c CPU,256Gb RAM, 128Gb SSD/3x900Gb SAS, Proxmox picture

Dell PowerEdge R720 Server - 2x8c CPU,256Gb RAM, 128Gb SSD/3x900Gb SAS, Proxmox

$340.00



Dell PowerEdge R620 Server 2x E5-2660 v1 2.2GHz 16 Cores 256GB RAM 2x 300GB HDD picture

Dell PowerEdge R620 Server 2x E5-2660 v1 2.2GHz 16 Cores 256GB RAM 2x 300GB HDD

$79.19



Dell PowerEdge R720XD Xeon E5-2680 V2 2.8GHz 20 Cores 256GB RAM 12x4TB picture

Dell PowerEdge R720XD Xeon E5-2680 V2 2.8GHz 20 Cores 256GB RAM 12x4TB

$510.00



Dell PowerEdge R730XD 28 Core Server 2X Xeon E5-2680 V4 H730 128GB RAM No HDD picture

Dell PowerEdge R730XD 28 Core Server 2X Xeon E5-2680 V4 H730 128GB RAM No HDD

$389.99



DELL POWEREDGE T430 SERVER W/ DUAL XEON E5-2609 CPU & 16GB MEMORY picture

DELL POWEREDGE T430 SERVER W/ DUAL XEON E5-2609 CPU & 16GB MEMORY

$329.00



Dell PowerEdge R620 4-Bay Server 2x Xeon E5-2690 8 Core 2.9GHz 32GB No HDD H710P picture

Dell PowerEdge R620 4-Bay Server 2x Xeon E5-2690 8 Core 2.9GHz 32GB No HDD H710P

$95.63



CTO Dell PowerEdge R630 Server, 2x Xeon E5-2620V4, 64GB- 512GB RAM, 480GB SSDs picture

CTO Dell PowerEdge R630 Server, 2x Xeon E5-2620V4, 64GB- 512GB RAM, 480GB SSDs

$246.67



Dell PowerEdge R620 Server 2x E5-2650 V2 = 16 Cores H710P 128GB RAM 2x 600GB SAS picture

Dell PowerEdge R620 Server 2x E5-2650 V2 = 16 Cores H710P 128GB RAM 2x 600GB SAS

$274.99



DELL PowerEdge R730 Server 2x E5-2690v3 2.6GHz =24 Cores 32GB H730 4xRJ45 picture

DELL PowerEdge R730 Server 2x E5-2690v3 2.6GHz =24 Cores 32GB H730 4xRJ45

$274.00



Dell Poweredge R730xd 2.5in 2x E5-2690 v3 2.6ghz 24-Cores  64gb  H730  2x 750w picture

Dell Poweredge R730xd 2.5in 2x E5-2690 v3 2.6ghz 24-Cores 64gb H730 2x 750w

$289.99