2024年9月3日 11:16:50
This commit is contained in:
parent
008926db52
commit
ff9d0e9225
@ -1,8 +1,15 @@
|
|||||||
# 项目实战 - 基础交换网络设计
|
# 项目实战 - 基础交换网络设计
|
||||||
|
|
||||||
![image-20240903094302311](https://picgo-noriu.oss-cn-beijing.aliyuncs.com/Images/image-20240903094302311.png)
|
![image-20240903111352230](https://picgo-noriu.oss-cn-beijing.aliyuncs.com/Images/image-20240903111352230.png)
|
||||||
|
|
||||||
![image-20240902173915624](https://picgo-noriu.oss-cn-beijing.aliyuncs.com/Images/image-20240902173915624.png)
|
- **需求**
|
||||||
|
- 公司有三个部门,财务部,市场部,技术部,为了内网安全,给每个部门单独划分一个VLAN
|
||||||
|
- 财务部:vlan10、市场部:vlan20、技术部:vlan30
|
||||||
|
- 公司所有部门,所有VLAN内的主机都通过DHCP服务器分发IP地址
|
||||||
|
- 每个部门,每个VLAN的网关地址都为,192.168.xx.254
|
||||||
|
- SW5中每个vlanif 虚接口地址都为 192.168.xx.254
|
||||||
|
- SW5通过vlanif50与DHCP进行通信,DHCP服务器管理IP:192.168.50.1
|
||||||
|
- 所有的PC都通过SW5与DHCP服务器进行通信,获取IP地址,所以SW5是DHCP中继
|
||||||
|
|
||||||
### 一、IP、VLAN、Routing
|
### 一、IP、VLAN、Routing
|
||||||
|
|
||||||
@ -102,15 +109,15 @@
|
|||||||
```
|
```
|
||||||
[HX-SW5]dhcp enable
|
[HX-SW5]dhcp enable
|
||||||
[HX-SW5]int Vlanif 10
|
[HX-SW5]int Vlanif 10
|
||||||
[HX-SW5-Vlanif10]ip add 192.168.10.251 24
|
[HX-SW5-Vlanif10]ip add 192.168.10.254 24
|
||||||
[HX-SW5-Vlanif10]dhcp select relay
|
[HX-SW5-Vlanif10]dhcp select relay
|
||||||
[HX-SW5-Vlanif10]dhcp relay server-ip 192.168.50.1
|
[HX-SW5-Vlanif10]dhcp relay server-ip 192.168.50.1
|
||||||
[HX-SW5-Vlanif10]int Vlanif 20
|
[HX-SW5-Vlanif10]int Vlanif 20
|
||||||
[HX-SW5-Vlanif20]ip add 192.168.20.251 24
|
[HX-SW5-Vlanif20]ip add 192.168.20.254 24
|
||||||
[HX-SW5-Vlanif20]dhcp select relay
|
[HX-SW5-Vlanif20]dhcp select relay
|
||||||
[HX-SW5-Vlanif20]dhcp relay server-ip 192.168.50.1
|
[HX-SW5-Vlanif20]dhcp relay server-ip 192.168.50.1
|
||||||
[HX-SW5-Vlanif20]int Vlanif 30
|
[HX-SW5-Vlanif20]int Vlanif 30
|
||||||
[HX-SW5-Vlanif30]ip add 192.168.30.251 24
|
[HX-SW5-Vlanif30]ip add 192.168.30.254 24
|
||||||
[HX-SW5-Vlanif30]dhcp select relay
|
[HX-SW5-Vlanif30]dhcp select relay
|
||||||
[HX-SW5-Vlanif30]dhcp relay server-ip 192.168.50.1
|
[HX-SW5-Vlanif30]dhcp relay server-ip 192.168.50.1
|
||||||
```
|
```
|
||||||
@ -165,85 +172,15 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
****
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### 三、VLAN间通信
|
|
||||||
|
|
||||||
> 要实现vlan间通信需修改vlanif的IP地址,修改为DHCP分配的网关地址
|
|
||||||
|
|
||||||
#### 1、配置
|
|
||||||
|
|
||||||
- **HX - SW5**
|
|
||||||
|
|
||||||
```
|
|
||||||
[HX-SW5]int Vlanif 10
|
|
||||||
[HX-SW5-Vlanif10]ip add 192.168.10.254 24
|
|
||||||
[HX-SW5-Vlanif10]int Vlanif 20
|
|
||||||
[HX-SW5-Vlanif20]ip add 192.168.20.254 24
|
|
||||||
[HX-SW5-Vlanif20]int Vlanif 30
|
|
||||||
[HX-SW5-Vlanif30]ip add 192.168.30.254 24
|
|
||||||
```
|
|
||||||
|
|
||||||
#### 2、测试
|
|
||||||
|
|
||||||
- **PC1 PING PC2**
|
|
||||||
|
|
||||||
```
|
|
||||||
PC1>ping 192.168.20.253
|
|
||||||
|
|
||||||
Ping 192.168.20.253: 32 data bytes, Press Ctrl_C to break
|
|
||||||
From 192.168.20.253: bytes=32 seq=1 ttl=127 time=109 ms
|
|
||||||
From 192.168.20.253: bytes=32 seq=2 ttl=127 time=78 ms
|
|
||||||
From 192.168.20.253: bytes=32 seq=3 ttl=127 time=79 ms
|
|
||||||
From 192.168.20.253: bytes=32 seq=4 ttl=127 time=78 ms
|
|
||||||
From 192.168.20.253: bytes=32 seq=5 ttl=127 time=78 ms
|
|
||||||
|
|
||||||
--- 192.168.20.253 ping statistics ---
|
|
||||||
5 packet(s) transmitted
|
|
||||||
5 packet(s) received
|
|
||||||
0.00% packet loss
|
|
||||||
round-trip min/avg/max = 78/84/109 ms
|
|
||||||
```
|
|
||||||
|
|
||||||
- **PC1 PING PC3**
|
|
||||||
|
|
||||||
```
|
|
||||||
PC1>ping 192.168.30.253
|
|
||||||
|
|
||||||
Ping 192.168.30.253: 32 data bytes, Press Ctrl_C to break
|
|
||||||
From 192.168.30.253: bytes=32 seq=1 ttl=127 time=94 ms
|
|
||||||
From 192.168.30.253: bytes=32 seq=2 ttl=127 time=78 ms
|
|
||||||
From 192.168.30.253: bytes=32 seq=3 ttl=127 time=79 ms
|
|
||||||
From 192.168.30.253: bytes=32 seq=4 ttl=127 time=93 ms
|
|
||||||
From 192.168.30.253: bytes=32 seq=5 ttl=127 time=94 ms
|
|
||||||
|
|
||||||
--- 192.168.30.253 ping statistics ---
|
|
||||||
5 packet(s) transmitted
|
|
||||||
5 packet(s) received
|
|
||||||
0.00% packet loss
|
|
||||||
round-trip min/avg/max = 78/87/94 ms
|
|
||||||
```
|
|
||||||
|
|
||||||
- **PC2 PING PC3**
|
|
||||||
|
|
||||||
```
|
|
||||||
PC2>ping 192.168.30.253
|
|
||||||
|
|
||||||
Ping 192.168.30.253: 32 data bytes, Press Ctrl_C to break
|
|
||||||
From 192.168.30.253: bytes=32 seq=1 ttl=127 time=94 ms
|
|
||||||
From 192.168.30.253: bytes=32 seq=2 ttl=127 time=78 ms
|
|
||||||
From 192.168.30.253: bytes=32 seq=3 ttl=127 time=94 ms
|
|
||||||
From 192.168.30.253: bytes=32 seq=4 ttl=127 time=78 ms
|
|
||||||
From 192.168.30.253: bytes=32 seq=5 ttl=127 time=78 ms
|
|
||||||
|
|
||||||
--- 192.168.30.253 ping statistics ---
|
|
||||||
5 packet(s) transmitted
|
|
||||||
5 packet(s) received
|
|
||||||
0.00% packet loss
|
|
||||||
round-trip min/avg/max = 78/84/94 ms
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user