RE: [opensuse] running out of IP addresses for DHCP
I'd like to expand the pool of addresses DHCP hands out from, 192.168.2.0/255.255.255.0 to 192.168.0.0/255.255.255.0, however I am not sure how to do this correctly. Also, I'd like to remove the ranges of 192.168.2.0, 192.168.3.0 & 192.168.23.0, from the DHCP pool so I can reserve these ranges for manual assignments.
First off, the size of your subnet is always a power of two, that is 256, 512, 1024 etc., less the two end addresses. Also, simply moving 192.168.2.0/255.255.255.0 to 192.168.0.0/255.255.255.0 is not expanding it, it's merely moving it. To expand it, you'll also have to change the subnet mask. If you change it to 255.255.254.0 or /23, your subnet will then contain 512 (510 usable) addresses, starting at 192.168.0.0. Changing the subnet to 255.255.252.0 or /22 will give you 1024 addresses, ranging from 192.168.0.0 to 192.168.3.255. Since it appears that 192.168.3.x is already in use, you may have to do this in two stages, first to /23 and moving the 192.168.3.x users to the new /23 network. Then after that migration, expand the network to /22 and move those on the 192.168.23.x network to the new /22 network. The easiest way to move the systems is with the dhcp server. Cut the lease time to a low value, remove the old address pool and then simply wait for the users to move as their leases expire and get new addresses on the new 192.168.0.x network. After the move has been completed, you can put the lease time back to the normal value. When this is done, you'll have everyone on the 192.168.0.0/22 network, which will have 1022 usable addresses, ranging from 192.168.0.1 to 192.168.3.254. BTW, when specifying subnet masks, the slash format is preferable to dotted decimal, i.e /24 instead of 255.255.255.0. Also, the lowest and highest addresses are not available for use. They're considered the network and broadcast addresses and should never be assigned to a device. ~~~~~~~ Thank you all for the great responses and details. Would this work if I used 192.168.50./23 to give me a range from 192.168.50.0 to 192.168.53.0? Increasing the range from 254 addresses to 510 addresses would work for me. Again, many thanks. This is a great list. ~James -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
James D. Parra wrote:
Would this work if I used 192.168.50./23 to give me a range from 192.168.50.0 to 192.168.53.0? Increasing the range from 254 addresses to 510 addresses would work for me.
Again, many thanks. This is a great list.
A /23 subnet mask will give you 512 addresses and /22, 1024. The /x simply tells you how many of the 32 address bits are reserved for the network address and the remaning (32-x) can be used for computers, routers etc. So, with /23, you've got 23 network address bits and 32-23=9 address bits for the computers. 2^9=512 etc. Going the otherway, if you had 1000 computers, the smallest network you could use, would require 10 address bits for the computers, because 2^10=1024 is the smallest power of two that will contain sufficient addresses. So, to get back to your original question, if you can get by with less than 510 addresses, the solution is quite simple. 1) Set your DHCP leases to a short period. 2) Set the subnet mask, in the DHCP server for the 192.168.0.0 network to /23 3) After all the computers have had time for the DHCP leases to be renewed, with the new mask, increase the DHCP pool in the 192.168.0.0 network to include the 192.168.1.x range. Servers and other devices that don't use DHCP may have to be reconfigured at this point. 4) Move the 192.168.3.0 users over, either by manually connecting them to the 192.168.0.0 network or simply connect the two networks through a switch and turn off the DHCP server on the 192.168.3.0 network. All the hosts will move over when they renegotiate the DHCP lease. You may have to assign an alias IP address to servers etc., during the transistion. 5) Set the DHCP lease period back to normal. Repeat step 4 for the 192.168.23.0 users. You can avoid adjusting leases and some other issues, if you can arrange for a window where you can simply make all the changes at once and simply tell the users to reboot etc., the next morning. Don't forget, you may also have some DNS issues to worry about. Again here, an alias address can help. Simply configure the server with both old and new addresses and then change the DNS records. After allowing time for the DNS caches to expire, you can remove the aliases. If you have routers in there, you might expect some ICMP redirects telling computers to communicate directly to servers etc., until all the changes have been made. -- Use OpenOffice.org http://www.openoffice.org -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Sun, 3 Feb 2008, James D. Parra wrote:-
Would this work if I used 192.168.50./23 to give me a range from 192.168.50.0 to 192.168.53.0?
No. It would give you 192.168.50.0 to 192.168.51.255. Using a /22 would give you 192.168.48.0 to 192.168.51.255.
Increasing the range from 254 addresses to 510 addresses would work for me.
Again, many thanks. This is a great list.
Plan for future expansion. You can set up the DHCP netblock with the entire 192.168.0.0/16 allocation but only specify individual /24s or /23s. That way, when you start running out again, you can add another range within that allocation with ease. Using this, very little changes with your present setup. All you need to do is un-comment a range and reload/restart the DHCP daemon for the allocation to become active. shared-network MY_DOMAIN { subnet 192.168.0.0 netmask 255.255.0.0 { default-lease-time 259200; option routers 192.168.2.1; option subnet-mask 255.255.0.0; option broadcast-address 192.168.255.255; option domain-name "mydomain.com"; option domain-name-servers 192.168.2.2; option netbios-name-servers 192.168.2.2; option ntp-servers 192.168.2.2; option time-offset -28800; range dynamic-bootp 192.168.2.62 192.168.2.66; range dynamic-bootp 192.168.2.68 192.168.2.71; range dynamic-bootp 192.168.2.73 192.168.2.107; range dynamic-bootp 192.168.2.109 192.168.2.129; range dynamic-bootp 192.168.2.131 192.168.2.133; range dynamic-bootp 192.168.2.135 192.168.2.137; range dynamic-bootp 192.168.2.139 192.168.2.153; range dynamic-bootp 192.168.2.155 192.168.2.157; range dynamic-bootp 192.168.2.159 192.168.2.175; range dynamic-bootp 192.168.2.177 192.168.2.253; # each of these add 512 extra addresses # range dynamic-bootp 192.168.4.0 192.168.5.255; # range dynamic-bootp 192.168.6.0 192.168.7.255; # each of these add 1024 extra addresses # range dynamic-bootp 192.168.8.0 192.168.11.255; # range dynamic-bootp 192.168.12.0 192.168.15.255; # this adds 1792 extra addresses, and stops before the 192.168.23.0/24 block # range dynamic-bootp 192.168.16.0 192.168.22.255; # each of these adds 2048 extra addresses # the first one starts after the 192.168.23.0/24 block # range dynamic-bootp 192.168.24.0 192.168.31.255; # range dynamic-bootp 192.168.32.0 192.168.39.255; # range dynamic-bootp 192.168.40.0 192.168.47.255; # range dynamic-bootp 192.168.48.0 192.168.55.255; # range dynamic-bootp 192.168.56.0 192.168.63.255; # each of these adds 4096 extra addresses. # range dynamic-bootp 192.168.64.0 192.168.79.255; # range dynamic-bootp 192.168.80.0 192.168.95.255; # range dynamic-bootp 192.168.96.0 192.168.111.255; # range dynamic-bootp 192.168.112.0 192.168.127.255; # each of these adds 8192 extra addresses. # range dynamic-bootp 192.168.128.0 192.168.159.255; # range dynamic-bootp 192.168.160.0 192.168.191.255; # range dynamic-bootp 192.168.192.0 192.168.223.255; # last block. Contains broadcast address so drop range by one. # range dynamic-bootp 192.168.224.0 192.168.255.254; } Regards, David Bolt -- Team Acorn: http://www.distributed.net/ OGR-P2 @ ~100Mnodes RC5-72 @ ~15Mkeys SUSE 10.1 32bit | openSUSE 10.2 32bit | openSUSE 10.3 32bit | openSUSE 11.0a1 SUSE 10.1 64bit | openSUSE 10.2 64bit | openSUSE 10.3 64bit RISC OS 3.6 | TOS 4.02 | openSUSE 10.3 PPC |RISC OS 3.11 -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
David Bolt wrote:
On Sun, 3 Feb 2008, James D. Parra wrote:-
Would this work if I used 192.168.50./23 to give me a range from 192.168.50.0 to 192.168.53.0?
No. It would give you 192.168.50.0 to 192.168.51.255. Using a /22 would give you 192.168.48.0 to 192.168.51.255.
Increasing the range from 254 addresses to 510 addresses would work for me.
Again, many thanks. This is a great list.
Plan for future expansion. You can set up the DHCP netblock with the entire 192.168.0.0/16 allocation but only specify individual /24s or /23s. That way, when you start running out again, you can add another range within that allocation with ease. Using this, very little changes with your present setup. All you need to do is un-comment a range and reload/restart the DHCP daemon for the allocation to become active.
You still have to consider the subnet mask, which increases in powers of two. There's no point in offering addresses, beyond what the mask will allow. While it is possible to simply have, for example, three /24 address ranges, each with it's own sub net mask, to the local network, it adds complexity in the form of alias addresses on the router interface port and ICMP redirects. -- Use OpenOffice.org http://www.openoffice.org -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Sun, 3 Feb 2008, James Knott wrote:-
You still have to consider the subnet mask, which increases in powers of two. There's no point in offering addresses, beyond what the mask will allow.
Already covered by changing the lines: subnet 192.168.2.0 netmask 255.255.255.0 { and: option subnet-mask 255.255.255.0; to: subnet 192.168.0.0 netmask 255.255.0.0 { and: option subnet-mask 255.255.0.0; The DCHP server, while it knows the range is the full /16. However, it won't supply addresses outside those given by all the "range" lines.
While it is possible to simply have, for example, three /24 address ranges, each with it's own sub net mask, to the local network, it adds complexity in the form of alias addresses on the router interface port and ICMP redirects.
Shouldn't do. The routing table should end up looking similar to this: Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0 169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0 127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo 0.0.0.0 192.168.2.1 0.0.0.0 UG 0 0 0 eth0 No matter which ranges are enabled. Regards, David Bolt -- Team Acorn: http://www.distributed.net/ OGR-P2 @ ~100Mnodes RC5-72 @ ~15Mkeys SUSE 10.1 32bit | openSUSE 10.2 32bit | openSUSE 10.3 32bit | openSUSE 11.0a1 SUSE 10.1 64bit | openSUSE 10.2 64bit | openSUSE 10.3 64bit RISC OS 3.6 | TOS 4.02 | openSUSE 10.3 PPC |RISC OS 3.11 -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
participants (3)
-
David Bolt
-
James D. Parra
-
James Knott