The internet protocol, or IP, is the protocol used to send network traffic between hosts across the internet. It comes in two versions. IPv4 is what most system administrators think of as "IP", in which 32-bit network addresses on variable sized networks are used to address hosts. The second version, IPv6, uses 128-bit network addresses to address hosts, and provides some other changes to the protocol.
IPv4 Networking Concepts
IP Address:
172.17.5.3 = 10101100, 00010001, 00000101, 00000011
Netmask:
255.255.255.0.0 = 11111111, 11111111, 00000000, 00000000
An IPv4 address is a 32-bit number, normally expressed in decimal as four octets ranging in value from 0 to 255, separated by dots. The address is divided into two parts; the network part and the host part. All host on the same sabnet, which can talk to each other directly without a router, have the smae network part; the host part identifies a particular host on a subnet.
In the modern internet, the size of a subnet is variable. To know which part of an IPv4 address is the network part and which the host part, you must know the netmask which the network administrator has assigned to the subnet. The netmask indicates how many bits of the IPv4 address belongs to the subnet. The more bits that are available for the host part, the more hosts can be on the subnet.
The lowest possible address on a subnet (host part is all zeros in binary) is sometimes called the network address. The highest possible address on a subnet (host part is all ones in binary) is used for broadcast messages in IPv4, and is called the broadcast address.
Network masks are expressed in two forms. The older syntex for a netmask which uses 24 bits for the network part would read 255.255.255.0. A newer syntax called CIDR notation. would specify a network prefix of /24. Both syntaxes convey the same information, namely, how many leading bits in the IP address contribute to its network address.
The special address 127.0.0.1 with the 255.0.0.0 netmask always points to the local system ("localhost"), so that it can talk to itself using network protocols.
Linux network Configuration
Method-1
The easiest way to configure networking in Red Hat Enterprise Linux is to use the Network Manager application. It can set system-wide defaults that affect all users, or it can be configured to activate certain network interfaces (perhaps connected to VPN tunnels) only when particular users are logged in.
Steps for configuring an IPv4 network interface:
1. Right click the Network Manager applet and select Edit Connections.
2. Click Add or select a profile and click Edit button.
3. Make sure Connect automatically is checked so that the interface comes up immediately.
4. Also make sure Available to all users is checked so that the interface comes up for all users at boot and is not just up when the current user is looged in.
5. Select IPv4 Settings tab.
6. Select method as Automatic (DHCP) or Manual.
7. With Manual, click Add and specify the IPv4 address, netmask, gateway, and DNS servers.
8. Click Apply.
Q1. Use Network Manager to create a static network configuration profile for your serverX machine
1. Right click on the Network Manager applet icon, and choose Edit Connections.
2. Select System etho and Edit.
3. Navigate to the IPv4 Settings pannel.
4. Choose a configuration Method of Manual.
5. Add a new address lines.
6. Fill in the following paramaters.
A. Address: 192.168.0.100+X
B. Netmask: 24 (or 255.255.255.0)
C. Gateway: 192.168.0.254
D. DNS Servers: 192.168.0.254
E. Search domains: example.com
Display current routing table:
[student@serverx ~]$ ip route
192.168.0.0/24 dev etho proto kernel scope link src 192.168.0.1 metric 1 default via 192.168.0.1 dev etho proto static
Note: This shows us that we have a direct route to hosts on 192.168.0.0/24 out etho, and our source ip address is 192.168.0.1. Packets to host on other networks will be sent to the router at 192.168.0.1 which can be reached throught etho.
Confirm DNS operation:
[student@serverx ~]$ host instructor
instructor.example.com has address 192.168.0.254
[student@serverx ~]$ host instructor.example.com
instructor.example.com has address 192.168.0.254
[student@serverx ~]$ host 192.168.0.254
254.0.168.192.in-addr.arpa domain name pointer instructor.example.com
Confirm connectivity:
[student@serverx ~]$ ping instructor.example.com
[student@serverx ~]$ ping 192.168.0.254
Method-2
The normal network configuration files in /etc/sysconfig/network-scripts are updated and store the configuration settings.
Subnet Mask
Short for subnetwork mask, a subnet mask, subnet, or subnetting is a method of dividing a network of IP addresses into groups. Subnetting allows each computer or networking device in its own subnet to communicate with each other and still allow communication between subnets by routing the traffic through the network router. By dividing a network into subnets, it can improve network security and keep overall network traffic balanced. A common example of a subnet mask for class C IP addresses is 255.255.255.0 and is the default subnet mask for many computers and network routers.
Netmask
A netmask is a 32-bit mask used to divide an IP address into subnets and specify the networks available hosts. In a netmask, two bits are always automatically assigned. For example, in 255.255.225.0, "0" is the assigned network address; and in 255.255.255.255, "255" is the assigned broadcast address. The 0 and 255 are always assigned and cannot be used.
Below is an example of a netmask and an example of its binary conversion.
Counting out the bits in the binary conversion allows you to determine the netmask length. In the above example, you have an example of a 32-bit address. However, this address is a broadcast address and does not allow any hosts (computers or other network devices) to be connected to it.
A commonly used netmask is a 24-bit netmask, as seen below.
Using a 24-bit netmask, the network would be capable of 2,097,150 networks or 254 different hosts with an IP range of 192.0.1.x - 223.255.254.x. This is commonly plenty of addresses for one network.
A simple formula can be used to determine the capable amount of networks a netmask is able to support. With the understanding that the netmask length is 24, subtract three from that number, e.g. 24-3 = 21. Once this number is determined, take 2 to the x power - 2 (where x is the number you just determined). Which would be 2^21 - 2 = 2,097,150. You are subtracting two from this number because of the broadcast and network addresses that are already being used.
To determine the amount of hosts a netmask is capable of supporting is similar to the above. As you see by the above chart, we have eight zeros. This number is similar to the 21 we determined earlier. Therefore, 2 to the x power - 2. (where x is the number of zeros in the netmask). This would be 2^8 - 2 = 254. Again, two is subtracted from this number to account for the broadcast and network addresses.
Below is a breakdown of each of the commonly used network classes.
IPv4 Networking Concepts
IP Address:
172.17.5.3 = 10101100, 00010001, 00000101, 00000011
Netmask:
255.255.255.0.0 = 11111111, 11111111, 00000000, 00000000
An IPv4 address is a 32-bit number, normally expressed in decimal as four octets ranging in value from 0 to 255, separated by dots. The address is divided into two parts; the network part and the host part. All host on the same sabnet, which can talk to each other directly without a router, have the smae network part; the host part identifies a particular host on a subnet.
In the modern internet, the size of a subnet is variable. To know which part of an IPv4 address is the network part and which the host part, you must know the netmask which the network administrator has assigned to the subnet. The netmask indicates how many bits of the IPv4 address belongs to the subnet. The more bits that are available for the host part, the more hosts can be on the subnet.
The lowest possible address on a subnet (host part is all zeros in binary) is sometimes called the network address. The highest possible address on a subnet (host part is all ones in binary) is used for broadcast messages in IPv4, and is called the broadcast address.
Network masks are expressed in two forms. The older syntex for a netmask which uses 24 bits for the network part would read 255.255.255.0. A newer syntax called CIDR notation. would specify a network prefix of /24. Both syntaxes convey the same information, namely, how many leading bits in the IP address contribute to its network address.
The special address 127.0.0.1 with the 255.0.0.0 netmask always points to the local system ("localhost"), so that it can talk to itself using network protocols.
Linux network Configuration
Method-1
The easiest way to configure networking in Red Hat Enterprise Linux is to use the Network Manager application. It can set system-wide defaults that affect all users, or it can be configured to activate certain network interfaces (perhaps connected to VPN tunnels) only when particular users are logged in.
Steps for configuring an IPv4 network interface:
1. Right click the Network Manager applet and select Edit Connections.
2. Click Add or select a profile and click Edit button.
3. Make sure Connect automatically is checked so that the interface comes up immediately.
4. Also make sure Available to all users is checked so that the interface comes up for all users at boot and is not just up when the current user is looged in.
5. Select IPv4 Settings tab.
6. Select method as Automatic (DHCP) or Manual.
7. With Manual, click Add and specify the IPv4 address, netmask, gateway, and DNS servers.
8. Click Apply.
Q1. Use Network Manager to create a static network configuration profile for your serverX machine
1. Right click on the Network Manager applet icon, and choose Edit Connections.
2. Select System etho and Edit.
3. Navigate to the IPv4 Settings pannel.
4. Choose a configuration Method of Manual.
5. Add a new address lines.
6. Fill in the following paramaters.
A. Address: 192.168.0.100+X
B. Netmask: 24 (or 255.255.255.0)
C. Gateway: 192.168.0.254
D. DNS Servers: 192.168.0.254
E. Search domains: example.com
Display current routing table:
[student@serverx ~]$ ip route
192.168.0.0/24 dev etho proto kernel scope link src 192.168.0.1 metric 1 default via 192.168.0.1 dev etho proto static
Note: This shows us that we have a direct route to hosts on 192.168.0.0/24 out etho, and our source ip address is 192.168.0.1. Packets to host on other networks will be sent to the router at 192.168.0.1 which can be reached throught etho.
Confirm DNS operation:
[student@serverx ~]$ host instructor
instructor.example.com has address 192.168.0.254
[student@serverx ~]$ host instructor.example.com
instructor.example.com has address 192.168.0.254
[student@serverx ~]$ host 192.168.0.254
254.0.168.192.in-addr.arpa domain name pointer instructor.example.com
Confirm connectivity:
[student@serverx ~]$ ping instructor.example.com
[student@serverx ~]$ ping 192.168.0.254
Method-2
The normal network configuration files in /etc/sysconfig/network-scripts are updated and store the configuration settings.
Subnet Mask
Short for subnetwork mask, a subnet mask, subnet, or subnetting is a method of dividing a network of IP addresses into groups. Subnetting allows each computer or networking device in its own subnet to communicate with each other and still allow communication between subnets by routing the traffic through the network router. By dividing a network into subnets, it can improve network security and keep overall network traffic balanced. A common example of a subnet mask for class C IP addresses is 255.255.255.0 and is the default subnet mask for many computers and network routers.
Netmask
A netmask is a 32-bit mask used to divide an IP address into subnets and specify the networks available hosts. In a netmask, two bits are always automatically assigned. For example, in 255.255.225.0, "0" is the assigned network address; and in 255.255.255.255, "255" is the assigned broadcast address. The 0 and 255 are always assigned and cannot be used.
Below is an example of a netmask and an example of its binary conversion.
| Netmask: | 255. | 255. | 255. | 255 |
| Binary: | 11111111 | 11111111 | 11111111 | 11111111 |
| Netmask length | 8 | 16 | 24 | 32 |
A commonly used netmask is a 24-bit netmask, as seen below.
| Netmask: | 255. | 255. | 255. | 0 |
| Binary: | 11111111 | 11111111 | 11111111 | 00000000 |
| Netmask length | 8 | 16 | 24 | -- |
A simple formula can be used to determine the capable amount of networks a netmask is able to support. With the understanding that the netmask length is 24, subtract three from that number, e.g. 24-3 = 21. Once this number is determined, take 2 to the x power - 2 (where x is the number you just determined). Which would be 2^21 - 2 = 2,097,150. You are subtracting two from this number because of the broadcast and network addresses that are already being used.
To determine the amount of hosts a netmask is capable of supporting is similar to the above. As you see by the above chart, we have eight zeros. This number is similar to the 21 we determined earlier. Therefore, 2 to the x power - 2. (where x is the number of zeros in the netmask). This would be 2^8 - 2 = 254. Again, two is subtracted from this number to account for the broadcast and network addresses.
Below is a breakdown of each of the commonly used network classes.
| Class | Netmask length | # of networks | # of hosts | Netmask |
| Class A | 8 | 126 | 16,777,214 | 255.0.0.0 |
| Class B | 16 | 16,382 | 65,534 | 255.255.0.0 |
| Class C | 24 | 2,097,150 | 254 | 255.255.255.0 |
Comments
Post a Comment