There are now five devices, PC1 is connected to ROUT1, ROUT1 is connected to ROUT2, ROUT2 is connected to ROUT3, and ROUT3 is connected to PC2. The topology is as follows:
□—— ——○————○————○————□
PC1 ROUT1 ROUT2 ROUT3 PC2
< Br>
The static IP addresses of the five devices are:
PC1 192.168.1.88/24
ROUT1 192.168.1.128/24 192.168.2.128/24
ROUT2 192.168.2.66/24 192.168.3.66/24
ROUT3 192.168.3.100/24 192.168.4.33/24
PC2 192.168.4.66/24
PC1 is configured as follows:
#ifconfig eth0 192.168.1.88 netmask 255.255.255.0
#route add default gw 192.168.1.128
ROUT1 is configured as follows:
#ifconfig eth0 192.168.1.128 netmask 255.255.255.0
#ifconfig eth0: 1 192.168.2.128 netmask 255.255.255.0
#route Add -net 192.168.4.0/24 gw 192.168.2.66
ROUT2 is configured as follows:
#ifconfig eth0 192.168.2.66 netmask 255.255.255.0
#i Fconfig eth0: 1 192.168.3.66 netmask 255.255.255.0
#route add -net 192.168.1.0/24 gw 192.168.2.128
#route add -net 192.168.4.0/24 gw 192.168. 3.100
ROUT3 is configured as follows:
#ifconfig eth0 192.168.3.100 netmask 255.255.255.0
#ifconfig eth0: 1 192.168.4.33 netmask 255.255. 255.0
#route add -net 192.168.1.0/24 gw 192.168.3.66
PC2 is configured as follows:
#ifconfig eth0 192.168.4.66 netmask 255.255.255.0
#route add default gw 192.168.4.33
This way PC1 can ping PC2.
Note:
The above three routers are replaced by three PCs. To replace the router with a computer, you must enable the IP forwarding function of the computer. Change the content in /proc/sys/net/ipv4/ip_forward to 1 (default is 0), complete with the following command
#e cho 1 > /proc/sys/net/ipv4/ip_forward
After the network restart, the above file is automatically changed to 0
Add a few commands:
1, delete the default route
#route del default
2, view the route
#route -n
3, set the specified network segment routing
#route add -net 192.168.3.0 netmask 255.255.255.0 gw 192.168.6.66
or
#route Add -net 192.168.3.0/24 gw 192.168.6.66
4. Delete the specified network segment route
#route del -net 192.168.3.0 netmask 255.255.255.0< Br>
or
#route del -net 192.168.3.0/24
When using a computer, it often interacts with some encrypted documents, such as Zip, Rar, and even
For beginner Linux (me too), I dont want to mess with Linux in the virtual machine, and I dont want
Preparation before erection: To set up a DNS server, you must install a software program that provi
A few days ago, a Linux system administrator asked the author for help. He said th
Common commands for creating and deleting Linux directories
Linux signal signal processing mechanism
Liunx jdk installation tutorial
Solution to common problems under Linux system
Functions in awk Using Tutorials
Installing Virtualbox Virtual XP on Ubuntu System
Linux can use mencoder to extract the audio in the video
10 important Linux ps commands are actually
Linux, Mac and Windows platform installation Git diagram detailed tutorial
Windows XP operating system optimization essence
LOL August 14th free hero LOL this week week free heroes what
To the novice: Win Vista complete hard disk installation method
Win10 can't install apps/games? The solution that can only install up to 10 devices is
DELL server installation Windows 2008 r2 crack SLIC method
Win10 official version does not bind personal Microsoft account can be used by any account
How to add sleep option to the power button in Win8.1 system