网络拓扑:
Switch1为cisco三层交换机:
增加两个vlan:
vlan database
vlan 10
vlan 20
exit
把F0/1加入vlan 10,F0/2加入vlan 20:
con t
int f0/1
swit mode acc
swit acc vlan 10
speed 100
dep full
no shut
int f0/2
swit mode acc
swit acc vlan 20
speed 100
dup full
no shut
端口F0/12作为trunk:
int f0/12
swit mode trunk
swit trunk encap dot1q
no shut
设置vlan的ip
int vlan 10
ip add 192.168.10.1 255.255.255.0
no shut
int vlan 20
ip add 192.168.20.1 255.255.255.0
no shut
exit
开启三层交换机的路由:
ip routing
exit
Switch2为支持vlan的cisco交换机:
增加vlan 10
vlan database
vlan 10
exit
把F0/1加入vlan 10
con t
int f0/1
swit mode acc
swit acc vlan 10
speed 100
dup full
no shut
端口F0/12作为trunk:
int f0/12
swit mode trunk
swit trunk encap dot1q
no shut
exit
PC1:
ip:192.168.10.11/24 gateway:192.168.10.1
PC2:
ip:192.168.20.11/24 gateway:192.168.20.1
PC3:
ip:192.168.10.12/24 gateway:192.168.10.1
测试三台PC可以互通,配置完成。
没有评论:
发表评论