一、拓扑图
图片.jpg
二、实验要求
实验要求:
① 设置合理的STP优先级、边缘端口、Eth-trunk
② 企业内网划分多个vlan ,减少广播域大小,提高网络稳定性
③ 所有设备,在任何位置都可以telnet远程管理
④ 出口配置NAT
⑤ 所有用户均为自动获取ip地址
⑥ 在企业出口将内网服务器的80端口映射出去,允许外网用户访问
⑦ 企业财务服务器,只允许财务部(vlan 30)的员工访问。
三、实验步骤
基础接口IP已经配置完成
1、配置eth-trunk和vlan,以SW2为例,SW3、SW4、SW5类似。
接入层交换机配置
SW2配置
#创建vlan
vlan batch 10 20 999
#配置Eth-Trunk
interface Eth-Trunk2
port link-type trunk
port trunk allow-pass vlan 10 20 999
stp instance 0 cost 10000
mode lacp-static
#端口加入eth-trunk
interface GigabitEthernet0/0/1
eth-trunk 2
#终端接入端口配置:(SW2的Eth0/0/2口)配置access口,设置默认vlan
port link-type access
port default vlan 10
#stp设置
#各接入交换机eth-trunk口
stp instance 0 cost 10000
mode lacp-static
#SW1
#设置根桥
stp root primary
stp instance 0 cost 10000
mode lacp-static
核心交换机SW1配置
SW1
#创建Vlan
vlan batch 10 20 30 40 200 800 999
#创建多个eth-trunk
interface Eth-Trunk2
port link-type trunk
port trunk allow-pass vlan 10 20 999
stp instance 0 cost 10000
mode lacp-static
#端口加入eth-trunk2
interface GigabitEthernet0/0/1
eth-trunk 2
#其他eth-trunk配置类似
配置用户网关
#SW1
interface Vlanif10
ip address 192.168.10.1 255.255.255.0
#三层交换机和路由器对接
interface GigabitEthernet0/0/24
port link-type access
port default vlan 800
interface Vlanif800
ip address 192.168.254.2 255.255.255.0
核心交换机DHCP配置
#SW1
#开启dhcp
dhcp enable
#核心交换机新建DHCP地址池
ip pool caiwu
gateway-list 192.168.30.1
network 192.168.30.0 mask 255.255.255.0
dns-list 114.114.114.114 8.8.8.8
#在Vlanif出设置网关,
interface Vlanif30
ip address 192.168.30.1 255.255.255.0
#选择全局的地址池给DHCP客户端使用。
dhcp select global
#
出口路由配置nat
#SW1
ip route-static 0.0.0.0 0.0.0.0 192.168.254.1
#R1
ip route-static 0.0.0.0 0.0.0.0 12.1.1.6
ip route-static 192.168.0.0 255.255.0.0 192.168.254.2
#配置acl私网地址路由器
acl number 2000
rule 5 permit source 192.168.0.0 0.0.255.255
#
#配置出口地址转换,关联到用户地址出口
interface GigabitEthernet0/0/1
nat outbound 2000
#
服务器端口映射(在企业出口将内网服务器的80端口映射出去,允许外网用户访问)
#R1
interface GigabitEthernet0/0/1
ip address 12.1.1.1 255.255.255.248
nat server protocol tcp global 12.1.1.2 www inside 192.168.200.10 www
#
ACL配置(企业财务服务器,只允许财务部(vlan 30)的员工访问。
)
#SW1
#
acl number 3000
rule 5 permit ip source 192.168.30.0 0.0.0.255 destination 192.168.200.20 0
rule 10 deny ip destination 192.168.200.20 0
#
#配置ACL在eth-trunk上生效
interface Eth-Trunk5
traffic-filter outbound acl 3000
#
在所有设备(路由、交换机)配置Vlan999的管理地址
#SW1
#
interface Vlanif999
ip address 192.168.253.1 255.255.255.0
#
(来自51cto肖老师课堂案例)