一、基本配置:
核心交换机LSW9的vlan 1配置了IP地址192.168.221.2/24,操作代码如下:
interface vlanif 1
ip address 192.168.221.2 24
核心交换机LSW6的vlan 1配置了IP地址172.16.221.2/24,操作代码如下:
interface vlanif 1
ip address 172.16.221.2 24
核心交换机LSW8的vlan 1配置了IP地址172.18.221.2/24,操作代码如下:
interface vlanif 1
ip address 172.18.221.2 24
路由器R6的G 0/0/0口配置了IP地址:172.17.221.1/24,
G 0/0/1口配置了IP地址:192.168.221.1/24,
操作代码如下:
interface GigabitEthernet 0/0/0
ip address 172.17.221.1 24
interface GigabitEthernet 0/0/1
ip address 192.168.221.1 24
路由器R5的G 0/0/0口配置了IP地址:172.17.221.2/24,
G 0/0/1口配置了IP地址:172.18.221.1/24,
G 0/0/2口配置了IP地址:172.16.221.1/24,
操作代码如下:
interface GigabitEthernet 0/0/0
ip address 172.17.221.2 24
interface GigabitEthernet 0/0/1
ip address 172.18.221.1 24
interface GigabitEthernet 0/0/2
ip address 172.16.221.1 24
二、在接入交换机中创建Vlan,把接口加入到规划的Vlan中:
根据该企业部门数量确定并划分vlan数量,此处划分为vlan 10 20 30 40 50。配置命令如下:
LSW2交换机连接了vlan10的主机,因此创建vlan10,并将两台主机加入,操作代码如下:
vlan 10
quit
interface Ethernet 0/0/1
port link-type access
port default vlan 10
interface Ethernet 0/0/2
port link-type access
port default vlan 10
同时配置GE 0/0/1接口,允许vlan10通过,操作代码如下:
interface GigabitEthernet 0/0/1
port link-type trunk
port trunk allow-pass vlan 10
LSW1交换机连接了vlan20、vlan30的主机,因此创建vlan20、30,并将两台主机加入,操作代码如下:
vlan batch 20 30
quit
interface Ethernet 0/0/1
port link-type access
port default vlan 20
interface Ethernet 0/0/2
port link-type access
port default vlan 30
同时配置GE 0/0/2接口,允许vlan20、30通过,操作代码如下:
interface GigabitEthernet 0/0/2
port link-type trunk
port trunk allow-pass vlan 20 30
LSW4交换机连接了vlan40、vlan50的主机,因此创建vlan40、vlan50,并将三台主机加入,操作代码如下:
vlan batch 40 50
quit
interface Ethernet 0/0/2
port link-type access
port default vlan 40
interface Ethernet 0/0/1
port link-type access
port default vlan 50
interface Ethernet 0/0/3
port link-type access
port default vlan 50
同时配置GE 0/0/2接口,允许vlan40、vlan50通过,操作代码如下:
interface Ethernet 0/0/2
port link-type trunk
port trunk allow-pass vlan 40 50
一、在核心交换机配置业务Vlan的网关地址:
Vlan的网关地址需要在核心交换机配置,具体配置如下:
在核心交换机LSW9中创建vlan10,并允许vlan10通过,进入vlan10,配置网关地址,操作代码如下:
vlan 10
quit
interface GigabitEthernet 0/0/24
port link-type trunk
port trunk allow-pass vlan 10
interface Vlanif 10
ip address 10.221.11.254 23
在核心交换机LSW6中创建vlan20、30,并允许vlan20、30通过,进入vlan20、30,配置网关地址,操作代码如下:
vlan batch 20 30
interface GigabitEthernet 0/0/23
port link-type trunk
port trunk allow-pass vlan 20 30
interface Vlanif 20
ip address10.221.20.254 24
interface Vlanif 30
ip address 10.221.30.254 24
在核心交换机S3中创建vlan40、50,并允许vlan40、50通过,进入vlan40、50,配置网关地址,操作代码如下:
Vlan batch 40 50
quit
interface GigabitEthernet 0/0/23
port link-type trunk
port trunk allow-pass vlan 40 50
interface Vlanif 40
ip address 10.221.40.254 24
interface Vlanif 50
ip address 10.221.51.254 23
二、在核心交换机配置链路聚合:
我是在LSW9与LSW2之间使用了链路聚合,具体配置如下:
LSW9与LSW2之间创建链路聚合,操作代码如下:
LSW9:
int Eth-Trunk 1
port link-type trunk
port trunk allow-pass vlan 10
eth-trunk 1
LSW2:
int Eth-Trunk 1
port link-type trunk
port trunk allow-pass vlan 10
eth-trunk 1
三、在交换机配置生成树协议:
根据题目要求,我选用LSW1、LSW4、LSW6、LSW8这四台交换机来创建生成树协议
操作代码如下:
LSW1、LSW4、LSW6、LSW8都为:
stp enable
stp mode stp
开启生成树协议,并将生成树协议模式设为stp
四、配置IPv4 路由协议:
核心交换机LSW9:
ip route-static 10.221.20.0 255.255.255.0 192.168.221.1
ip route-static 10.221.30.0 255.255.255.0 192.168.221.1
ip route-static 10.221.40.0 255.255.255.0 192.168.221.1
ip route-static 10.221.50.0 255.255.254.0 192.168.221.1
核心交换机LSW6:
ip route-static 10.221.10.0 255.255.254.0 172.16.221.1
ip route-static 10.221.40.0 255.255.255.0 172.16.221.1
ip route-static 10.221.50.0 255.255.254.0 172.16.221.1
核心交换机LSW8:
ip route-static 10.221.10.0 255.255.254.0 172.18.221.1
ip route-static 10.221.20.0 255.255.255.0 172.18.221.1
ip route-static 10.221.30.0 255.255.255.0 172.18.221.1
路由器R6:
ip route-static 10.221.10.0 255.255.254.0 192.168.221.2
ip route-static 10.221.20.0 255.255.255.0 172.17.221.2
ip route-static 10.221.30.0 255.255.255.0 172.17.221.2
ip route-static 10.221.40.0 255.255.255.0 172.17.221.2
ip route-static 10.221.50.0 255.255.254.0 172.17.221.2
路由器R5:
ip route-static 10.221.10.0 255.255.254.0 172.17.221.1
ip route-static 10.221.20.0 255.255.255.0 172.16.221.2
ip route-static 10.221.30.0 255.255.255.0 172.16.221.2
ip route-static 10.221.40.0 255.255.255.0 172.18.221.2
ip route-static 10.221.50.0 255.255.254.0 172.18.221.2