Article Title: instance parsing a router built using the Linux operating system. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
Network structure. The computer of the Linux router is identified as A. It is connected to three network segments, 192.168.1.0/24, 10.0.0.0/8, and 172.16.0.0/16.
Computer A must have three NICs connected to the three network segments.
Hypothesis:
Eth0 is connected to 172.16.0.0,
Eth1 is connected to 10.0.0.0,
Eth2 is connected to 192.168.1.0.
First, configure eth0. assign the address 172.16.1.1 to this network interface and run the following command:
# Ifconfig eth0 172.16.1.1 netmask 255.255.0.0
To make the address disappear after the computer is no longer restarted, edit the/etc/sysconfig/network-scripts/ifcfg-eth0 file to the following format:
DEVICE = eth0
ONBOOT = yes
BROADCAST = 172.16.0000255
NETWORK = 172.16.0.0
NETMASK = 255.255.0.0
IPADDR = 172.16.1.1
Add a static route:
# Route add-net 172.16.0.0 netmask 255.255.0.0
In this way, a static route is added to the system:
# Route Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface
172.16.0.0*255.255.0.0 U 0 0 0 eth0
Next, configure eth1, and connect eth1 to the 10.0.0.0 network segment. The address assigned to it is 10.254.254.254. Use the ifconfig command to configure parameters for it:
# Ifconfig eth1 10.254.254.254 netmask 255.0.0.0
[1] [2] Next page