1 | 配pc地址 | |
c1 | ip 192.168.10.10 192.168.10.1 | |
c2 | ip 192.168.20.10 192.168.20.1 | |
c3 | ip 192.168.10.10 192.168.10.1 | |
c4 | ip 192.168.20.20 192.168.20.1 |
2 | 二层交换sw1配置 | no ip routing(关闭路由功能) |
sw1创vlan10,20 | vlan 10,20 | |
f1/0 配到vlan10 改access | int f1/0 | |
sw m a | ||
sw a v 10 | ||
f1/1 配到vlan20 改access | int f1/1 | |
sw m a | ||
sw a v 20 | ||
f1/14 1/15 改trunk | int r f1/14 -15 | |
sw m t | ||
vlan 1 配ip 192.168.1.100/24 | int vlan 1 | |
ip add 192.168.1.100 255.255.255.0 | ||
vlan 1 配网关 | ip default - gateway 192.168.1.1 |
3 | 二层交换sw2置 | |
sw1创vlan10,20 | vlan 10,20 | |
f1/0 配到vlan10 改access | int f1/0 | |
sw m a | ||
sw a v 10 | ||
f1/1 配到vlan20 改access | int f1/1 | |
sw m a | ||
sw a v 20 | ||
f1/14 改trunk | int f1/14 | |
sw m t | ||
vlan 1 配ip 192.168.1.200/24 | int vlan 1 | |
ip add 192.168.1.200 255.255.255.0 | ||
vlan 1 配网关 | ip default - gateway 192.168.1.1 |
4 | 三层交换R1配置 | |
ip routing | 开启三层路由 | |
vlan 10,20 | 创建vlan10,20 | |
int vlan 1 | 进vlan1 配地址 | |
ip add 192.168.10.1 255.255.255.0 | ||
no sh | ||
int vlan 10 | 进vlan10 配地址 | |
ip add 192.168.10.1 255.255.255.0 | ||
no sh | ||
int vlan 20 | 进vlan20 配地址 | |
ip add 192.168.20.1 255.255.255.0 | ||
no sh | ||
int f1/15 | f1/15改trunk | |
sw m t |
5.ping检查:
PC1 ping PC2,PC3,PC4
SW1 ping SW2
转载于:https://blog.51cto.com/13469709/2044624