SoFunction
Updated on 2025-04-11

Settings of IP addresses in LAN

The TCP/IP protocol, namely Transmission Control Protocol/Internet Protocol transmission control protocol/Internet protocol, is one of the most perfect and widely accepted communication protocols at present. It is not only used to realize the mutual communication between different types of networks and different types of chips and operating systems in the wide area network, but is also widely used in various types of Ethernet. Whether it is the peer-to-peer network of Windows 95/98, Windows NT, Unix, Linux, and NetWare, it currently supports this protocol. How to assign an IP address to all devices is a very technical job. Let’s take Windows 95/98 peer network and Windows NT Server/Client network as examples to introduce the allocation and setting of IP addresses.

1. Introduction to IP address

Each host and device on the network should have at least one unique IP address so that a specific device can be found accurately. An IP address is a four-byte (32-bit) string, each byte is written as a decimal number, separated by a dot (i.e., period), such as 192.168.8.88. Since each part of an IP address is 1 byte, its value must be between 0 and 255 (including 0 and 255). An IP address includes two parts, namely the network part and the host (or node) part. How to simply specify the first two bytes as network numbers, on the one hand, there will be no more than 216 (65536) hosts on any network (even for WAN), and on the other hand, the address space will be wasted due to the small number of some smaller network nodes. In order to effectively utilize the limited address space, IP addresses are divided into three "classes" according to the first few bits, namely Class A, Class B and Class C.

* Class A The first byte ranges from 0 to 127. Although there are only 127 network numbers, each network can accommodate up to 160,000,000 hosts (connected computers). Unfortunately, the network with so many hosts almost does not exist at all.

* Class B The first byte ranges from 128 to 191, has 16,000 network numbers, and each network can accommodate up to 60,000 hosts.

* Class C The first byte ranges from 192 to 223, has 2080800 network numbers, and each network can accommodate up to 254 hosts.

For example, 18.88.89.98 is a Class A address, where 18 is the network number, 88.89.98 is the host number; 128.188.189.198 is a Class B address, where 128.188 is the network number, and 189.198 is the host number; 198.168.186.169 is a Class C address, where 198.168 is the network number and 186.169 is the host number.

2. Settings of fixed IP addresses

(I) The allocated IP address can meet the needs of the network

Our IP address space can generally be obtained by applying directly to the local ISP (usually the local telecommunications department). When the IP address assigned to you can fully meet the needs of the LAN from the network number to the host number, you are really lucky. Just simply specify an IP address for each host and the device that can be managed separately. Of course, you should create a necessary log file to record the allocation of the IP address for future queries.

1. IP address settings of Windows 95/98 host

Install TCP/IP protocol. Click the "Add" button in the Control Panel Network Configuration tab, select "Protocol" from the list box and click the "Add" button again, then select "Microsoft" in the "Manufacturer" list box, select "TCP/IP" in the "Network Protocol" list box, click the "OK" button and insert the Windows 98 installation CD according to the prompts. Of course, you need to restart your computer so that the new settings take effect.

Specify the IP address. In the Control Panel -> Network -> Configuration tab, select the TCP/IP protocol bound to the network card (as shown in Figure 2), click the "Properties" button, select the Specify IP Address option button in the IP Address tab, and then type the IP address and subnet mask assigned to the host (as shown in Figure 3). If the class A IP address is assigned, its subnet mask is 255.0.0.0; if the class B IP address is assigned, its subnet mask is 255.255.0.0; if the class C IP address is assigned, its subnet mask is 255.255.255.0. It should be noted that IP addresses with all host parts of 0 or 255 cannot be used because the value has been defined and retained as a broadcast address within the network.

2. IP address settings of Windows NT host

Install TCP/IP protocol. Click the Add button in the Control Panel -> Network -> Protocol tab, then select the TCP/IP protocol in the Network Protocol list box, click the OK button, and insert the Windows NT installation disk according to the prompts. After the machine restarts, the protocol is added.

Specify the IP address. Select the TCP/IP communication protocol in the Network Protocol list box of the Control Panel -> Network -> Protocol tab, and click the Properties button. Since Windows NT can install two network cards, different network cards should be selected in the IP address -> Adapter drop-down list box to configure them separately. After selecting the Specify IP Address option button, type the IP address and subnet mask assigned to it (as shown in Figure 4). The default gateway refers to the IP address of the router used to connect to other networks, but if the local machine acts as a router connecting two different subnets, it can be set as the address of the local machine.

3. IP address settings of network-connected devices

Take the 3om Super Stack II Switch 1100 Hub as an example.

(1) Establish a connection with the terminal. Use a randomly given nine-core crossover cable to connect the serial port of the computer to the Console port of the Hub, start the computer, run the Hyper Terminal program in the attachment, establish a new connection, and select the Direct to Com in the box in the Connect Using drop-down column. Then set the baud rate to 9600 in the properties in the string, set the data bits to 8, the parity bits to None, the Stop bits to 1 bit, and the Flow control to None (as shown in Figure 5).

(2) Log in. After the Hub is connected, press Enter to display the login information and enter the default username and password.

Login: security

Password: security

Enter the main menu and the information is displayed as follows:

(3) Configure the IP address. Type ip in the Select menu option line and enter. After entering the IP submenu, the following content is displayed:

Type interface in the Select menu option line and press Enter to display the following content:

Enter the command define on the Select menu option (ip/interface) line, and then type its IP address (IP address), subnet mask (subnet mask) and default gateway (default gateway) according to the prompts. The binaries of Enter SLIP address and Enter SLIP subnet mask can be ignored. After the configuration is completed, the system will redisplay the configured information to confirm. At this time, type q to return to the previous menu.

At this point, the IP address has been configured and can be verified by Ping or Display.

(II) The allocated IP address can only meet the requirements for the number of hosts

I believe you also know that due to the continuous expansion of Internet access families, there are very few IP address resources left today. Therefore, the address of a C class you get may not meet your need to establish several subnets in the LAN, so you have to use the Subnet Mask to solve your urgent needs.

The subnet mask is also represented by four bytes 24 bits, and the default subnet mask is shown in the table. Its main functions include two aspects: one is to distinguish the network number and host number of IP addresses, and the other is to divide a certain type of address into several subnets.

The subnet mask has a partial positioning network number and the subnet mask has a partial positioning host number. Therefore, when the IP address and the subnet mask are matched (and), the non-zero part is the network number, and the zero part is the host number. If the IP address of a certain device is 168.186.89.88, its binary representation is 10101000 1011101010101000. Since it belongs to a Class B address, its subnet mask is 255.255.0.0, its binary representation is 11111111111 111111 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

Since the part of the subnet mask with 1 can be defined as a network number, we can modify the highest bit part of the mask with 0 to 1 by modifying the subnet mask, so as to change the part that should belong to the host number to become a network number, thereby achieving the purpose of demarcating the molecule network. For example, you get a C-class network address 198.189.98. There is no doubt that all devices from 198.189.98.0 - 198.189.98.254 will be in the same network, but you need to divide your network into 5 subnets for easy management. It's very simple. We can take out the first three digits in the fourth byte in 255.255.255.0 as the subnet mask, that is, modify the original fourth byte from 00000000 to 11100000. Since the decimal value of 11100000 is 224, the subnet mask should be set to 255.255.255.224. These three have eight different combination methods, including 000, 001, 010, 011, 100, 101, 110, 111, and 111. In addition to the fact that 000 and 111 cannot be used as reserved addresses, there are six combinations that can be used to establish a subnet. Of course, the first three bytes of each subnet are still 198.189.98, so the IP address range provided by each subnet is:

It can be seen that the more bits the subnet mask is, the more the number of subnets obtained, but the fewer the number of hosts contained in each subnet, and the more IP resources are lost. This is because each subnet will retain two addresses with all 0 or all 1 as broadcast addresses.

(III) Neither the network nor the host number can meet the needs

As IP address resources become increasingly exhausted, fewer and fewer IP addresses available for allocation are often available. A network with hundreds of computers can only get a few IP addresses, which is really frustrating. In this case, we can only use the proxy server method to implement mutual conversion between internal URLs and public URLs. IANA (Internet Assigned Numbers Authority) reserves the following addresses as private IP address spaces, and is specifically used for the use of internal LANs of enterprises. They are:

You can choose the appropriate address category according to your needs (depending on the number of network hosts and devices). Within the enterprise, you can use and configure the address as a public IP address with confidence. Through a proxy server, on the one hand, when the host within the LAN accesses the Internet, the proxy server accepts the request from the private address, obtains the requested information from the public Internet, and returns it to the original user, or simply converts the private IP address from the internal to a public IP address to realize communication with the Internet host, so that all hosts in the internal network have the ability to access the Internet through the proxy server. Of course, you can also place necessary restrictions on the access capabilities of certain hosts if you need it. On the other hand, external hosts can also access the host you specified through a proxy server that allows external access, thereby realizing two-way communication between internal and external hosts.

3. Settings of dynamic IP addresses

Dynamic IP address, as the name implies, means that the IP address obtained by the device is non-fixed and can be dynamically allocated and obtained. There are two main reasons for using dynamic IP addresses: one is that you can build a larger network with fewer IP addresses. If the public IP addresses are obtained slightly fewer than the hosts and other devices connected to the network, if each device is assigned a fixed IP address, then it is obvious that some computers will not be able to access the network. Considering that not all computers are running and connected to the network at the same time, if the IP is dynamically allocated, that is, the computer automatically obtains it when it is connected to the network and automatically reclaims it when it is disconnected, it can meet the network's IP address needs. The second is to increase the mobility of computers within the network. When a host moves from one subnet to another, due to the different network numbers in the IP address, the computer cannot communicate with other hosts. The easiest way to solve this problem is to re-assign an IP address to the mobile host in the new subnet. However, if we adopt dynamic IP addresses, this complexity of network management will be reduced.

Windows NT uses DHCP (Dynamic Host Configuration Protocol) to solve the allocation of dynamic IP addresses. When using DHCP, at least one Windows NT host in the entire network must be equipped with DHCP software to act as a DHCP server, and all other workstations that want to use DHCP functions must also have DHCP support functions. In this way, when the DHCP workstation starts, it will automatically communicate with the DHCP server and the DHCP server provides it with an IP address. Of course, this address is only temporary. When the lease expires, the address will be returned to the DHCP server and provided to other DHCP workstations for use. If the original DHCP workstation still needs an IP address, you can rent another IP address from the DHCP server.

(I) Settings of DHCP server

Open the Control Panel -> Network -> Services tab, click the Add button, select "Microsoft DHCP Server" in the Network Services list box (as shown in Figure 6), click the OK button, put the NT CD-ROM according to the prompts to complete the file copy, click the Close button, and then restart the computer.

Open Administration Tools -> DHCP Manager and select the local host DHCP server. Open the menu scope -> Create, and the Create Domain dialog box pops up, type the start and end addresses and subnet mask respectively. If you want to keep a certain address for use by a specific host or device, you can set it in the exclusion range. It is recommended to choose the time limit for the lease period and specify the lease period as required. After confirmation, a new IP address range is added to the local computer. The yellow light bulb indicates that the IP address range has been enabled (as shown in Figure 7).

If you want to retain certain IP addresses to certain specific devices (such as DHCP server, WWW server, E-mail server, FTP server, Router, Switch Hub, etc.), you can use the retained customer settings. Open the Management Tools -> DHCP Server, double-click to open the local computer, and select the IP address range. Open Menu Scope -> Add reserved location, type the ID number of the host network card or device in the unique identifier, type the IP address you want to reserve for it in the IP address, and give the device a simple and easy-to-remember name in the customer name. If you want to continue to specify an IP address for other devices, you can click the Add button, otherwise, you can close and exit. After the addition is completed, you can use the menu scope -> Activity Rental command to check, or you can use the attributes to make corresponding modifications here.

Note: DHCP server should use a fixed IP address.

(II) Settings of Windows 95/98 DHCP workstation

First, it should be confirmed that the workstation has TCP/IP protocol installed. Open the Control Panel -> Network -> TCP/IP -> Properties -> IP Address tab bound to the network card, and select Automatically obtain an IP address.

Article entry: dnbm     Editor: dnbm