1.先配交换机trunk

三层:int f0/0

sw tr enca do

sw mod tr

二层:int f0/0

sw mod tr


2.划分vlan以及vtp server/client


vlan 划分:vlan 10

name vlan10

vtp server: vtp mod server

vtp domain +名字

vtp passwod +密码

vtp client:vtp mod client

vtp domain +名字

vtp passwod +密码


3.把对应端口加到想要划分的VLAN中


在sw1上把pc0对应的端口划分到vlan10,把pc1对应的端口划分到vlan20

在sw1上把pc2对应的端口划分到vlan10,把pc3对应的端口划分到vlan20

在sw3上把服务器对应的端口划分到vlan30


4.汇聚层

在AC1上分别给vlan10 20 30 40配地址

int vlan10

ip addr 172.16.10.252 255.255.255.0

int vlan20

ip addr 172.16.20.252 255.255.255.0

int vlan30

ip addr 172.16.30.252 255.255.255.0

int vlan40

ip addr 172.16.40.252 255.255.255.0

在AC2

int vlan10

ip addr 172.16.10.254 255.255.255.0

int vlan20

ip addr 172.16.20.254 255.255.255.0

int vlan30

ip addr 172.16.30.254 255.255.255.0

int vlan40

ip addr 172.16.40.254 255.255.255.0


5.在AC1和AC2上构建一个虚拟的ip

AC1:

spanning-tree vlan10,30 primary

spanning-tree vlan20,40 secondary

int vlan10

standby 10 ip 172.16.10.1

standby 10 priority 100 设置优先级

standby preempt 抢占,线路可以自动切换


int vlan20

standby 10 ip 172.16.20.1

standby 10 priority 80 设置优先级

standby preempt 抢占,线路可以自动切换


int vlan30

standby 10 ip 172.16.30.1

standby 10 priority 100 设置优先级

standby preempt 抢占,线路可以自动切换


AC2:

spanning-tree vlan20,40 primary

spanning-tree vlan10,30 secondary

int vlan10

standby 10 ip 172.16.10.1

standby 10 priority 80 设置优先级

standby preempt 抢占,线路可以自动切换


int vlan20

standby 10 ip 172.16.20.1

standby 10 priority 100 设置优先级

standby preempt 抢占,线路可以自动切换


int vlan30

standby 10 ip 172.16.30.1

standby 10 priority 80 设置优先级

standby preempt 抢占,线路可以自动切换


6.给服务器配static地址

并且作为vlan 10,20的dhcp的服务器


7.在AC1和AC2上配置vlan10,20的dhcp帮助地址

int vlan10/20

ip helper-address 172.16.30.2


8.CE路由器,core1和2 给端口配IP地址

交换机no switchport 升级端口 ,可以配IP

ip routing 让交换机具有路由的功能

启用ospf协议

把汇聚层向上连得接口放到area 0

向下连的vlan放到area 1

router ospf 1

router-id 1.1.1.1

network 192.168.1.1 0.0.0.255 area 0

network 192.168.7.2 0.0.0.255 area 1


在CE上配置

int lo100

ip add 100.100.100.100 255.255.255.0

exit

ip route 0.0.0.0 0.0.0.0 100.100.100.1下放缺省路由