# 2.0版本
[TOC]
## 实现的功能摘要
1. 实现大楼间的通信
2. 整个内部网络中使用动态路由协议
<br>
## 设备设置
**路由器**
R1:
```
# 首先将路由器加入OSPF
[R1]ospf 1 router-id 4.4.4.4
[R1-ospf-1]area 0
[R1-ospf-1-area-0.0.0.0]network 192.168.3.0 0.0.0.255
# 配置路由器GE 0/0/0端口地址为192.168.3.1 24
# 配置路由器GE 0/0/1端口地址为210.96.100.1
[R1-ospf-1-area-0.0.0.0]int g0/0/1
[R1-GigabitEthernet0/0/1]ip add 210.96.100.1 24
[R1-GigabitEthernet0/0/1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip add 192.168.3.1 24
[R1-GigabitEthernet0/0/0]quit
[R1]ip route-static 0.0.0.0 0.0.0.0 g0/0/1
[R1]ospf 1
[R1-ospf-1]default-route-advertise
[R1-ospf-1]return
<R1>save
The current configuration will be written to the device.
Are you sure to continue? (y/n)[n]:y
It will take several minutes to save configuration file, please wait......
Configuration file had been saved successfully
Note: The configuration file will take effect after being activated
```
**核心交换机**
S1:
```
# 首先设置vlan1 2 3并添加对应的ip
[S1]vlan b 1 2 3
Info: This operation may take a few seconds. Please wait for a moment...done.
[S1]int v1
[S1-Vlanif1]ip add 192.168.1.2 24
[S1-Vlanif1]int v2
[S1-Vlanif2]ip add 192.168.2.2 24
[S1-Vlanif2]int v3
[S1-Vlanif3]ip add 192.168.3.2 24
# 设置g0/0/1 g0/0/2 g0/0/3对应的vlan
[S1-Vlanif3]int g0/0/1
[S1-GigabitEthernet0/0/1]port link-type access
[S1-GigabitEthernet0/0/1]port default vlan 1
[S1-GigabitEthernet0/0/1]int g0/0/2
[S1-GigabitEthernet0/0/2]port link-type access
[S1-GigabitEthernet0/0/2]port default vlan 2
[S1-GigabitEthernet0/0/2]int g0/0/3
[S1-GigabitEthernet0/0/3]port link-type access
[S1-GigabitEthernet0/0/3]port default vlan 3
[S1-GigabitEthernet0/0/3]quit
# 设置ospf
[S1]ospf 1 router-id 1.1.1.1
[S1-ospf-1]area 0
[S1-ospf-1-area-0.0.0.0]network 192.168.1.0 0.0.0.255
[S1-ospf-1-area-0.0.0.0]network 192.168.2.0 0.0.0.255
[S1-ospf-1-area-0.0.0.0]network 192.168.3.0 0.0.0.255
[S1-ospf-1-area-0.0.0.0]return
<S1>save
The current configuration will be written to the device.
Are you sure to continue?[Y/N]y
Now saving the current configuration to the slot 0.
Save the configuration successfully.
```
**三层交换机**
S2:
```
[S2]int v3
[S2-Vlanif3]ip add 192.168.1.1 24
[S2-Vlanif3]quit
[S2]int g0/0/3
[S2-GigabitEthernet0/0/3]port link-type access
[S2-GigabitEthernet0/0/3]port default vlan 3
[S2-GigabitEthernet0/0/3]quit
[S2]ospf 1 router-id 2.2.2.2
[S2-ospf-1]area 0
[S2-ospf-1-area-0.0.0.0]network 192.168.1.0 0.0.0.255
[S2-ospf-1-area-0.0.0.0]network 10.1.1.0 0.0.0.255
[S2-ospf-1-area-0.0.0.0]network 10.1.2.0 0.0.0.255
[S2-ospf-1-area-0.0.0.0]return
<S2>save
The current configuration will be written to the device.
Are you sure to continue?[Y/N]y
Now saving the current configuration to the slot 0.
Save the configuration successfully.
```
S3:
```
[S3]int v3
[S3-Vlanif3]ip add 192.168.2.1 24
[S3-Vlanif3]quit
[S3]int g0/0/3
[S3-GigabitEthernet0/0/3]port link-type access
[S3-GigabitEthernet0/0/3]port default vlan 3
[S3-GigabitEthernet0/0/3]quit
[S3]ospf 1 router-id 3.3.3.3
[S3-ospf-1]area 0
[S3-ospf-1-area-0.0.0.0]network 192.168.2.0 0.0.0.255
[S3-ospf-1-area-0.0.0.0]network 10.2.1.0 0.0.0.255
[S3-ospf-1-area-0.0.0.0]network 10.2.2.0 0.0.0.255
[S3-ospf-1-area-0.0.0.0]return
<S3>save
The current configuration will be written to the device.
Are you sure to continue?[Y/N]y
Now saving the current configuration to the slot 0.
Save the configuration successfully.
```
<br>
## 测试
以PC1(10.1.1.10)为例,测试各PC机之间的连通性。
```
PC>ping 10.2.1.10
Ping 10.2.1.10: 32 data bytes, Press Ctrl_C to break
From 10.2.1.10: bytes=32 seq=1 ttl=125 time=141 ms
From 10.2.1.10: bytes=32 seq=2 ttl=125 time=125 ms
From 10.2.1.10: bytes=32 seq=3 ttl=125 time=109 ms
From 10.2.1.10: bytes=32 seq=4 ttl=125 time=141 ms
From 10.2.1.10: bytes=32 seq=5 ttl=125 time=109 ms
--- 10.2.1.10 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 109/125/141 ms
PC>ping 10.2.1.10
Ping 10.2.1.10: 32 data bytes, Press Ctrl_C to break
From 10.2.1.10: bytes=32 seq=1 ttl=125 time=125 ms
From 10.2.1.10: bytes=32 seq=2 ttl=125 time=109 ms
From 10.2.1.10: bytes=32 seq=3 ttl=125 time=110 ms
--- 10.2.1.10 ping statistics ---
3 packet(s) transmitted
3 packet(s) received
0.00% packet loss
round-trip min/avg/max = 109/114/125 ms
```
可以看到,不同大楼的PC间可以实现通讯。本环节实验成功。
<br>
## 结构图
![image-20201223155217713](https://gitee.com/Huohua2020/Img/raw/master/img/20201223155219.png)
YOLO数据集工作室
- 粉丝: 711
- 资源: 1590
最新资源
- 51单片机485全双工通信protues仿真C语言.zip
- 51单片机1602字符液晶滚动演示程序protues仿真.zip
- 51单片机1602液晶显示的DS1302实时时钟protues仿真C语言.zip
- 由信安之路团队成员收集整理的与渗透测试相关的 Github 项目地址,如果你由更好的项目请将项目地址发送到myh0st@foxmail.com.zip
- 51单片机1602+ds12b80+ds1302+音乐+电子书+流水灯的多功能电子表protues仿真.zip
- 51单片机BCD译码数码管显示数字protues仿真.zip
- 51单片机AT24C02的多机通信protues仿真C语言.zip
- 51单片机12864LCD图形滚动演示protues仿真C语言.zip
- 51单片机DS18B20温度传感器protues仿真.zip
- 51单片机DS1302的日历时钟protues仿真.zip
- 51单片机DS1302时钟+DS18B20+无线遥控应用程序protues仿真.zip
- 51单片机lcd1602屏protues仿真keil工程源码.zip
- 51单片机报警器与旋转灯protues仿真keil工程.zip
- 51单片机protues仿真驱动屏幕滚动显示文字keil工程源码.zip
- 51单片机电机转速表设计protues仿真.zip
- 51单片机电机控制_L298 protues仿真.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈