当前位置:网站首页>Configuration of routers and static routes
Configuration of routers and static routes
2022-08-05 06:22:00 【sologuai】
目录
一、路由概述
路由:从源主机到目标主机的转发过程
路由器工作原理:根据路由表转发数据
二、静态路由和默认路由
1.静态路由 : The network administrator manually configures the unknown network segment into the routing table manually,Allows precise control over the behavior of routes,静态路由是单向的,并且缺乏灵活性.
2.默认路由:When the router cannot find a routing entry for the destination network in the routing table,路由器把请求转发到默认路由接口.The default route is generally configured on the stub network,There is only one import and export,One end is generally connectedPC机.(避免出现环路)默认路由是一种特殊的静态路由.
三、配置静态路由
实验步骤:
(1)为两台PC机配置IP地址、子网掩码和网关地址
(2)配置路由器R1的IP地址
<Huawei>sys //进入系统视图
[Huawei]sys R1 //Change the router name
[R1]int g0/0/0 //进入g0/0/0 接口
[R1-GigabitEthernet0/0/0]ip add 192.168.1.254/24 //配置g0 ip地址
[R1-GigabitEthernet0/0/0]int g0/0/1 //进入g0/0/1 接口
[R1-GigabitEthernet0/0/1]ip add 192.168.3.1/24 //配置IP地址
(3)配置路由器R2的IP地址
<Huawei>sys //进入系统视图
[Huawei]sys R2 //Change the router name
[R2]int g0/0/0 //进入g0/0/0 接口
[R2-GigabitEthernet0/0/0]ip add 192.168.3.2/24 //配置g0 ip地址
[R2-GigabitEthernet0/0/0]int g0/0/1 //进入g0/0/1 接口
[R2-GigabitEthernet0/0/1]ip add 192.168.4.1/24 //配置IP地址
(3)配置路由器R3的IP地址
<Huawei>sys //进入系统视图
[Huawei]sys R2 //Change the router name
[R1]int g0/0/0 //进入g0/0/0 接口
[R1-GigabitEthernet0/0/0]ip add 192.168.4.2/24 //配置g0 ip地址
[R1-GigabitEthernet0/0/0]int g0/0/1 //进入g0/0/1 接口
[R1-GigabitEthernet0/0/1]ip add 192.168.2.254/24 //配置IP地址
(4)Configure static routing information for the three routers.The network segment will not be directly connected、子网掩码、The next hop address is added to the routing table(两种方法)
法一:
①R1设置默认路由
[R1]ip route-static 0.0.0.0 0.0.0.0 192.168.3.2 //任意网段 Arbitrary subnet mask 下一跳地址
②R2设置静态路由
[R2]ip route-static 192.168.1.0 24 192.168.3.1 //非直连网段 子网掩码 下一跳地址
[R2]ip route-static 192.168.2.0 24 192.168.3.2 //非直连网段 子网掩码 下一跳地址
③R3设置默认路由
[R3]ip route-static 0.0.0.0 0.0.0.0 192.168.4.1 //任意网段 Arbitrary subnet mask 下一跳地址
法二:
①R1设置静态路由
[R1]ip route-static 192.168.4.0 24 192.168.3.2 //Configure the network segment as10.1.3.0的路由信息
[R1]ip route-static 192.168.2.0 24 192.168.3.2 //Configure the network segment as10.1.4.0的路由信息
②R2设置静态路由
[R2]ip route-static 192.168.1.0 24 192.168.3.1 //Configure the network segment as10.1.1.0的路由信息
[R2]ip route-static 192.168.2.0 24 192.168.4.2 //Configure the network segment as10.1.4.0的路由信息
③R3设置静态路由
[R3]ip route-static 192.168.1.0 24 192.168.4.1 //Configure the network segment as10.1.1.0的路由信息
[R3]ip route-static 192.168.3.0 24 192.168.4.1 //Configure the network segment as10.1.2.0的路由信息
④用PC1去pingPC2
实验成功!
边栏推荐
- King power volume LinkSLA, realize operations engineer is happy fishing
- 磁盘管理与文件系统
- Cloud computing - osi seven layers and TCP\IP protocol
- 单臂路由实验和三层交换机实验
- 干货!教您使用工业树莓派结合CODESYS配置EtherCAT主站
- Growth: IT Operations Trends Report
- Configuration of TensorFlow ObjecDetectionAPI under Anaconda3 of win10 system
- OpenCV3.0 is compatible with VS2010 and VS2013
- 多线程之传递参数
- Call the TensorFlow Objection Detection API for object detection and save the detection results locally
猜你喜欢
NAT experiment
Mongodb query analyzer parsing
入职前,没想到他们玩的这么花
[问题已处理]-虚拟机报错contains a file system with errors check forced
I/O performance and reliability
技术分享杂七杂八技术
From "dual card dual standby" to "dual communication", vivo took the lead in promoting the implementation of the DSDA architecture
错误类型:反射。ReflectionException:无法设置属性“xxx”的“类”xxx”与价值“xxx”
5分钟完成mysql离线安装
Cloud computing - osi seven layers and TCP\IP protocol
随机推荐
Logical volume creation
King power volume LinkSLA, realize operations engineer is happy fishing
正则表达式小实例--去掉字符串中间和两边的空格
time complexity and space complexity
By solving these three problems, the operation and maintenance efficiency will exceed 90% of the hospital
From "dual card dual standby" to "dual communication", vivo took the lead in promoting the implementation of the DSDA architecture
Transport layer protocol (TCP 3-way handshake)
wc、grep、tar、vi/vim
Take you in-depth understanding of cookies
Cloud computing - osi seven layers and TCP\IP protocol
Servlet跳转到JSP页面,转发和重定向
Technology Sharing Miscellaneous Technologies
Advantages of overseas servers
请问下通过flink sql读取hologres 的两张表的 binlog,然后如何进行join?
Wechat applet page jump to pass parameters
产品学习资料
OpenCV3.0 is compatible with VS2010 and VS2013
TCP/IP four-layer model
Dry!Teach you to use industrial raspberries pie combining CODESYS configuration EtherCAT master station
Difference between link and @improt