当前位置:网站首页>The most detailed network counting experiment in history (2) -- rip experiment of layer 3 switch
The most detailed network counting experiment in history (2) -- rip experiment of layer 3 switch
2022-04-23 19:19:00 【It's quite bald, Qi Qi】
This blog continues to explain layer 3 switches and dynamic routing in computer networks RIP Protocol experiments .
First, let's introduce the layer 3 switch , What we did before vlan The experiment uses a two-layer switch , Its function is to pc Connect the machine . On this basis, the layer 3 switch adds the function of connecting different LANs similar to routers , In LAN internal network, three-layer switch can be used to replace router , However, the interconnection between LAN and public network can not completely replace the work of router . What we used before vlan, When given a network number , In fact, it can represent a local area network .
Say again RIP agreement , Actually RIP The protocol is the algorithm that the router automatically configures the routing table . The static routing table we configured before requires us to manually enter , When multiple routers are connected, it will be very cumbersome , And when the connection is disconnected due to a problem with the line or equipment , The routing table can be adjusted dynamically , send pc Normal communication .


After talking about the principle , Let's start with the basics of the configuration experiment ip.

Layer 3 switch configuration :
Switch>en
Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#vlan 10
Switch(config-vlan)#name v10
Switch(config-vlan)#exit
Switch(config)#vlan 50
Switch(config-vlan)#name v50
Switch(config-vlan)#exit
Switch(config)#int f0/5
Switch(config-if)#switchport access vlan 50 ## take f0/5 Port join vlan50
Switch(config-if)#exit
Switch(config)#int f0/1
Switch(config-if)#switchport access vlan 10
Switch(config-if)#exit
Switch(config)#
Router Router0 Set up :
Router>en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#int f 1/0
Router(config-if)#ip addr 192.168.1.1 255.255.255.0 ## Set the port ip And mask
Router(config-if)#no sh ##no shutdown Abbreviation , Open port
Router(config-if)#
%LINK-5-CHANGED: Interface FastEthernet1/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet1/0, changed state to up
Router(config-if)#exit
Router(config)#int se 2/0
Router(config-if)#ip addr 192.168.2.1 255.255.255.0
Router(config-if)#no sh
%LINK-5-CHANGED: Interface Serial2/0, changed state to down
Router(config-if)#exit
Router(config)#
The rest Router1 Also set as above , It's just a show here .
After configuring the above, let's start with the... In the layer 3 switch vlan No. configuration ip.
Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#int vlan 10 ## Enter into vlan 10 And configure ip
Switch(config-if)#
%LINK-5-CHANGED: Interface Vlan10, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan10, changed state to up
Switch(config-if)#ip addr 192.168.1.2 255.255.255.0 ## You can find that it is actually related to the port of the router ip equally , Its function is to interface vlan 10 The router address is 192.168.1.2 The interface of
Switch(config-if)#no sh
Switch(config-if)#exit
Switch(config)#int vlan 50
Switch(config-if)#
%LINK-5-CHANGED: Interface Vlan50, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan50, changed state to up
Switch(config-if)#ip addr 192.168.5.1 255.255.255.0
Switch(config-if)#no sh
Switch(config-if)#exit
Switch(config)#ip routing ## This step is very important , Is equivalent to vlan in ip Update the information and put it in the table
Switch(config)#
We can check the success through the command .
Switch#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is not set
C 192.168.1.0/24 is directly connected, Vlan10 ## These two lines indicate success
C 192.168.5.0/24 is directly connected, Vlan50
Switch#
End of configuration vlan Of ip after , We can divide different LANs and communicate through three-tier switches , Next, turn on the layer 3 switch and router RIP agreement .
The network number of each network segment :

First, turn on the protocol of the layer 3 switch :
Switch#en
Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#router rip ## Configuration command
Switch(config-router)#network 192.168.1.0 ## Declare the direct network segment of this machine
Switch(config-router)#network 192.168.5.0
Switch(config-router)#exit
Switch(config)#
Next, the router Router 0 Open agreement :
Router>en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#router rip
Router(config-router)#network 192.168.1.0
Router(config-router)#network 192.168.2.0
Router(config-router)#exit
Router(config)#
Router Router 1 similar , There's no show here . When we're done, let's look at the routing table .
Three layer switch :
Switch#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is not set
C 192.168.1.0/24 is directly connected, Vlan10
R 192.168.2.0/24 [120/1] via 192.168.1.1, 00:00:18, Vlan10 ## Yes R These two items indicate success
R 192.168.3.0/24 [120/2] via 192.168.1.1, 00:00:18, Vlan10
C 192.168.5.0/24 is directly connected, Vlan50
Switch#
Router 0 Routing table :
Router#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is not set
C 192.168.1.0/24 is directly connected, FastEthernet1/0
C 192.168.2.0/24 is directly connected, Serial2/0
R 192.168.3.0/24 [120/1] via 192.168.2.2, 00:00:18, Serial2/0
R 192.168.5.0/24 [120/1] via 192.168.1.2, 00:00:16, FastEthernet1/0
Router#
And then pc See if you can ping through .

ping The experiment proved our success , If you do real machine experiments , I'm still saying , Remember to turn off the firewall !
版权声明
本文为[It's quite bald, Qi Qi]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204210600172028.html
边栏推荐
- White screen processing method of fulter startup page
- How about CICC wealth? Is it safe to open an account up there
- Partage de la conception de l'alimentation électrique de commutation et illustration des compétences en conception de l'alimentation électrique
- Screen right-click menu in souI
- 浅谈c语言指针的强制转换
- 网络协议之:sctp流控制传输协议
- Accessing private members using templates
- UML类图几种关系的总结
- openlayers draw矩形
- c1000k TCP 连接上限测试1
猜你喜欢

Sword finger offer II 116 Number of provinces - spatial complexity O (n), time complexity O (n)

OpenHarmony开源开发者成长计划,寻找改变世界的开源新生力!
![[today in history] April 23: the first video uploaded on YouTube; Netease cloud music officially launched; The inventor of digital audio player was born](/img/0a/ed4eab6589e1c072edc247463e889e.png)
[today in history] April 23: the first video uploaded on YouTube; Netease cloud music officially launched; The inventor of digital audio player was born

Openharmony open source developer growth plan, looking for new open source forces that change the world!

【C语言进阶11——字符和字符串函数及其模拟实现(2))】

剑指 Offer II 116. 省份数量-空间复杂度O(n),时间复杂度O(n)

8266 obtain 18b20 temperature

An algorithm problem was encountered during the interview_ Find the mirrored word pairs in the dictionary

Why is PostgreSQL about to surpass SQL Server?

ArcMap publishing slicing service
随机推荐
FTP、ssh远程访问及控制
Oracle配置st_geometry
Codeforces Round #784 (Div. 4)
I just want to leave a note for myself
js上传文件时控制文件类型和大小
JS controls the file type and size when uploading files
std::stoi stol stoul stoll stof stod
UML类图几种关系的总结
js 计算时间差
Disable Ctrl + Alt + Del
SSDB基础
Xlslib use
Prefer composition to inheritance
First experience of using fluent canvas
What is a message queue
【玩转Lighthouse】腾讯云轻量服务器搭建全平台视频解析视频下载网站
MySQL practical skills
arcMap 发布切片服务
c1000k TCP 连接上限测试1
SQL常用的命令