How to configure /etc/networks and /etc/netmasks when subnetting
Solaris / OpenSolarisThis forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Solaris 10, Solaris Express Community Edition
Posts: 547
Rep:
How to configure /etc/networks and /etc/netmasks when subnetting
Hi.
I have a private network which actually is a 192.168.0.0/24. I decided to subnet the private 192.168.0.0/16 addresses using 3 bits, so I'll end up with:
192.168.0.0/19
192.168.32.0/19
192.168.64.0/19
192.168.96.0/19
192.168.128.0/19
192.168.160.0/19
192.168.192.0/19
192.168.224.0/19
The question now is: what should I put into /etc/networks and /etc/netmasks? Is it sufficient to just put 192.168 into /etc/networks and 255.255.224.0 into /etc/netmasks?
Distribution: Solaris 10, Solaris Express Community Edition
Posts: 547
Original Poster
Rep:
Quote:
This is all handled by routers. The /etc/networks and /etc/netmasks files are very data, and almost never used. Do you see a need for them?
Thank you Mr. C.
I don't see much use to them but I was following the official Solaris documentation and I had this doubt because it seemed a mandatory configuration.
By the way, speaking about routers, I suppose I should reconfigure the router from 192.168.0.1/24 to 192.168.0.1/19, right?
And the last question is about reconfiguring the Solaris DHCP server. I already have a macro for the network 192.168.0.0 and now I'm thinking about how to partition IP numbers in order to give, for example, an IP number in a specific subnet to a predefined subset of clients. If I'm not misled, the only way to do this kind of things (with just one DHCP server) would be filtering by MAC address (which doesn't seem a clever solution to me...) Maybe I should isolate the specific subset of clients so that they could see only one of several DHCP servers, and in this case I would need a certain number of additional routers. Any other ideas? I don't know how this kind of things is handled in the real world.
Right, you'll want to configure your perimeter router to place all packets destined for your 192.168.0.1/19 on the wire. What other routers downstream do after that is their business. No if you only have one router, then you really aren't subnetting, and just have a single /19 address space.
To assign static IPs via DHCP (static leases), you need to create an assignment on the DHCP server per-MAC/IP pair. This is a good solution when you want permanent IP addresses for things like printers, and want the advantage of DNS and other IP settings to be automatic. No need generally to do this for random clients.
If you've subnetted, your DHCP server, depending upon its location, may be able to provide the correct IP ranges for each subnet. Create the proper network clauses in the DHCP server.
Distribution: Solaris 10, Solaris Express Community Edition
Posts: 547
Original Poster
Rep:
Thank you Mr. C.
Yes, nowadays I just have one router. The reason I wanted to subnet is that I must establish a VPN tunnel with a SOHO WatchGuard router with another office. Only a subset of the machines should be able to see the other network, so I thought about using a /19 address space and, for example, configure the trusted network of the WatchGuard as, for example, 192.168.96.x/19. Clients with IP in 192.168.{0,32,64,128,160,192,224} then should not be able to connect to the VPN. Even if I'm not really subnetting because I just have one router (the ISP router...), it should be sufficient for this to work, at least it's what I'm hoping.
Quote:
If you've subnetted, your DHCP server, depending upon its location, may be able to provide the correct IP ranges for each subnet. Create the proper network clauses in the DHCP server.
I'll check the documentation another time, thanks. In this network I just have 1 DHCP server, which is connected via a switch to the other machines and to the router, I haven't other locations to put it.
Distribution: Solaris 10, Solaris Express Community Edition
Posts: 547
Original Poster
Rep:
Quote:
If you've subnetted, your DHCP server, depending upon its location, may be able to provide the correct IP ranges for each subnet.
Thanks for all the information you provided, Mr. C.
Can you please elaborate your quoted statement? I've been reading Solaris 10 documentation but, surely because of my lack of knowledge, I found no hint about such a configuration.
Sure. A sub-netted network generally implies internal router's are used, one per (sub-)network, to divide a larger network address space. If the DHCP server is running on the routing station, it can listen on all interfaces and provide configuration information for those networks by using the appropriate subnet statements within the DHCP configuration file.
If the DHCP server is not on the routing station, it can still provide configuration information to any of the networks, but requires a DHCP relay to do so (DHCP broadcasts, like all broadcast packets, do not cross routers).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.