1 案例:园区网项目建设 – 基础交换网络设计
1.1 需求
- 总部有4个部门,为确保通信安全,将每个部门分配不同的网段
- 每个部门的IP网段为:192.168.xx.0/24
- 每个部门主机设置为自动获取IP地址,并且主机网关IP为192.168.xx.254
1.2 方案
使用eNSP搭建实验环境,如图-1所示。
1.3 步骤
实现此案例需要按照如下步骤进行。[hidecontent type=”payshow”]
配置终端设备 – PC1~PC8 为 DHCP 客户端
配置网络设备 – 每个交换机配置相同的vlan
- <Huawei>undo terminal monitor
- <Huawei>system–view
- [Huawei]sysname SW1
- [SW1]vlan batch 10 20 30 40 66
- [SW1]
- <Huawei>undo terminal monitor
- <Huawei>system–view
- [Huawei]sysname SW2
- [SW2]vlan batch 10 20 30 40 66
- [SW2]
- <Huawei>undo terminal monitor
- <Huawei>system–view
- [Huawei]sysname SW3
- [SW3]vlan batch 10 20 30 40 66
- [SW3]
- <Huawei>undo terminal monitor
- <Huawei>system–view
- [Huawei]sysname SW4
- [SW4]vlan batch 10 20 30 40 66
- [SW4]
- <Huawei>undo terminal monitor
- <Huawei>system–view
- [Huawei]sysname SW6
- [SW6]vlan batch 10 20 30 40 66
- [SW6]
3)配置网络设备 – 配置交换机之间的 Trunk 链路
- [SW1]interface gi0/0/2 #连接SW6
- [SW1–GigabitEthernet0/0/2]port link–type trunk
- [SW1–GigabitEthernet0/0/2]port trunk allow–pass vlan all
- [SW1–GigabitEthernet0/0/2]quit
- [SW2]interface gi0/0/2 #连接SW6
- [SW2–GigabitEthernet0/0/2]port link–type trunk
- [SW2–GigabitEthernet0/0/2]port trunk allow–pass vlan all
- [SW2–GigabitEthernet0/0/2]quit
- [SW3]interface gi0/0/2 #连接SW6
- [SW3–GigabitEthernet0/0/2]port link–type trunk
- [SW3–GigabitEthernet0/0/2]port trunk allow–pass vlan all
- [SW3–GigabitEthernet0/0/2]quit
- [SW4]interface gi0/0/2 #连接SW6
- [SW4–GigabitEthernet0/0/2]port link–type trunk
- [SW4–GigabitEthernet0/0/2]port trunk allow–pass vlan all
- [SW4–GigabitEthernet0/0/2]quit
- [SW6]port–group group–member gi0/0/11 gi0/0/12 gi0/0/13 gi0/0/14
- [SW6–port–group]port link–type trunk
- [SW6–port–group]port trunk allow–pass vlan all
- [SW6–port–group]quit
4)配置网络设备 – 交换机与终端设备之间的 access 链路
- [SW1]interface Ethernet0/0/1 #连接PC1
- [SW1–Ethernet0/0/1]port link–type access
- [SW1–Ethernet0/0/1]port default vlan 10
- [SW1–Ethernet0/0/1]quit
- [SW1]interface Ethernet0/0/2 #连接PC2
- [SW1–Ethernet0/0/2]port link–type access
- [SW1–Ethernet0/0/2]port default vlan 20
- [SW1–Ethernet0/0/2]quit
- [SW2]interface Ethernet0/0/3 #连接PC3
- [SW2–Ethernet0/0/3]port link–type access
- [SW2–Ethernet0/0/3]port default vlan 10
- [SW2–Ethernet0/0/3]quit
- [SW2]interface Ethernet0/0/4 #连接PC4
- [SW2–Ethernet0/0/4]port link–type access
- [SW2–Ethernet0/0/4]port default vlan 30
- [SW2–Ethernet0/0/4]quit
- [SW3]interface Ethernet0/0/5 #连接PC5
- [SW3–Ethernet0/0/5]port link–type access
- [SW3–Ethernet0/0/5]port default vlan 20
- [SW3–Ethernet0/0/5]quit
- [SW3]interface Ethernet0/0/6 #连接PC6
- [SW3–Ethernet0/0/6]port link–type access
- [SW3–Ethernet0/0/6]port default vlan 40
- [SW3–Ethernet0/0/6]quit
- [SW4]interface Ethernet0/0/7 #连接PC7
- [SW4–Ethernet0/0/7]port link–type access
- [SW4–Ethernet0/0/7]port default vlan 40
- [SW4–Ethernet0/0/7]quit
- [SW4]interface Ethernet0/0/8 #连接PC8
- [SW4–Ethernet0/0/8]port link–type access
- [SW4–Ethernet0/0/8]port default vlan 30
- [SW4–Ethernet0/0/8]quit
2 案例:园区网项目建设 – 服务器部署
2.1 需求描述
- 每个部门主机设置为自动获取IP地址,并且主机网关IP为192.168.xx.254
- web 服务器单独属于一个网段,网关配置汇聚层交换机
- DHCP服务器单独属于一个网段,网关配置汇聚层交换机
- 为了增强网关稳定性和冗余性,每个部门都使用了网关冗余技术
2.2 方案
使用eNSP搭建实验环境,如图-2所示。
2.3 步骤
实现此案例需要按照如下步骤进行。
1)配置终端设备 PC-1~PC-8 为 DHCP 客户端
2)配置DHCP服务器
- <Huawei>undo terminal monitor
- <Huawei>system–view
- [Huawei]sysname DHCP–Server
- [DHCP]interface gi0/0/0
- [DHCP–GigabitEthernet0/0/0]ip address 192.168.66.1 24
- [DHCP–GigabitEthernet0/0/0]quit
- [DHCP]ip route–static 0.0.0.0 0.0.0.0 192.168.66.254
- [DHCP]dhcp enable
- [DHCP]ip pool VLAN10
- [DHCP–ip–pool–VLAN10]network 192.168.10.0 mask 24
- [DHCP–ip–pool–VLAN10]gateway–list 192.168.10.254
- [DHCP–ip–pool–VLAN10]quit
- [DHCP]ip pool VLAN20
- [DHCP–ip–pool–VLAN20]network 192.168.20.0 mask 24
- [DHCP–ip–pool–VLAN20]gateway–list 192.168.20.254
- [DHCP–ip–pool–VLAN20]quit
- [DHCP]ip pool VLAN30
- [DHCP–ip–pool–VLAN30]network 192.168.30.0 mask 24
- [DHCP–ip–pool–VLAN30]gateway–list 192.168.30.254
- [DHCP–ip–pool–VLAN30]quit
- [DHCP]ip pool VLAN40
- [DHCP–ip–pool–VLAN40]network 192.168.40.0 mask 24
- [DHCP–ip–pool–VLAN40]gateway–list 192.168.40.254
- [DHCP–ip–pool–VLAN40]quit
- [DHCP]interface gi0/0/0
- [DHCP–GigabitEthernet0/0/0]dhcp select global
- [DHCP–GigabitEthernet0/0/0]quit
3)配置 DHCP 中继,并在 DHCP 服务器上排除 SW6的网关IP地址
- [SW6]interface Vlanif 66 #DHCP服务器的网关IP地址
- [SW6–Vlanif66]ip address 192.168.66.254 255.255.255.0
- [SW6–Vlanif66]quit
- [SW6]dhcp enable
- [SW6]interface Vlanif 10
- [SW6–Vlanif10]ip address 192.168.10.252 255.255.255.0
- [SW6–Vlanif10]dhcp select relay
- [SW6–Vlanif10]dhcp relay server–ip 192.168.66.1
- [SW6–Vlanif10]quit
- [SW6]interface Vlanif 20
- [SW6–Vlanif20]ip address 192.168.20.252 255.255.255.0
- [SW6–Vlanif20]dhcp select relay
- [SW6–Vlanif20]dhcp relay server–ip 192.168.66.1
- [SW6–Vlanif20]quit
- [SW6]interface Vlanif 30
- [SW6–Vlanif30]ip address 192.168.30.252 255.255.255.0
- [SW6–Vlanif30]dhcp select relay
- [SW6–Vlanif30]dhcp relay server–ip 192.168.66.1
- [SW6–Vlanif30]quit
- [SW6]interface Vlanif 40
- [SW6–Vlanif40]ip address 192.168.40.252 255.255.255.0
- [SW6–Vlanif40]dhcp select relay
- [SW6–Vlanif40]dhcp relay server–ip 192.168.66.1
- [SW6–Vlanif40]quit
- [DHCP]ip pool VLAN10
- [DHCP–ip–pool–VLAN10]excluded–ip–address 192.168.10.252 #排除网关IP地址
- [DHCP–ip–pool–VLAN10]quit
- [DHCP]ip pool VLAN20
- [DHCP–ip–pool–VLAN20]excluded–ip–address 192.168.20.252 #排除网关IP地址
- [DHCP–ip–pool–VLAN20]quit
- [DHCP]ip pool VLAN30
- [DHCP–ip–pool–VLAN30]excluded–ip–address 192.168.30.252 #排除网关IP地址
- [DHCP–ip–pool–VLAN30]quit
- [DHCP]ip pool VLAN40
- [DHCP–ip–pool–VLAN40]excluded–ip–address 192.168.40.252 #排除网关IP地址
- [DHCP–ip–pool–VLAN40]quit
4)配置SW5以及互联的 SW1/2/3/4/6
- <Huawei>undo terminal monitor
- <Huawei>system–view
- [Huawei]sysname SW5
- [SW5]vlan batch 10 20 30 40 66 88
- [SW5]port–group group–member gi0/0/1 gi0/0/2 gi0/0/3 gi0/0/4 gi0/0/24
- [SW5–port–group]port link–type trunk
- [SW5–port–group]port trunk allow–pass vlan all
- [SW5–port–group]quit
- [SW5]interface gi0/0/8 #连接 Web 服务器的接口
- [SW5–GigabitEthernet0/0/8]port link–type access
- [SW5–GigabitEthernet0/0/8]port default vlan 88
- [SW5–GigabitEthernet0/0/8]quit
- [SW5]interface Vlanif 88 #Web服务器的网关接口
- [SW5–Vlanif88]ip address 192.168.88.254 255.255.255.0
- [SW5–Vlanif88]quit
- [SW1]vlan 88 #添加 VLAN 88
- [SW1–vlan88]quit
- [SW1]interface gi0/0/1 #连接SW5
- [SW1–GigabitEthernet0/0/1]port link–type trunk
- [SW1–GigabitEthernet0/0/1]port trunk allow–pass vlan all
- [SW1–GigabitEthernet0/0/1]quit
- [SW]vlan 88 #添加 VLAN 88
- [SW2–vlan88]quit
- [SW2]interface gi0/0/1 #连接SW5
- [SW2–GigabitEthernet0/0/1]port link–type trunk
- [SW2–GigabitEthernet0/0/1]port trunk allow–pass vlan all
- [SW2–GigabitEthernet0/0/1]quit
- [SW3]vlan 88 #添加 VLAN 88
- [SW3–vlan88]quit
- [SW3]interface gi0/0/1 #连接SW5
- [SW3–GigabitEthernet0/0/1]port link–type trunk
- [SW3–GigabitEthernet0/0/1]port trunk allow–pass vlan all
- [SW3–GigabitEthernet0/0/1]quit
- [SW4]vlan 88 #添加 VLAN 88
- [SW4–vlan88]quit
- [SW4]interface gi0/0/1 #连接SW5
- [SW4–GigabitEthernet0/0/1]port link–type trunk
- [SW4–GigabitEthernet0/0/1]port trunk allow–pass vlan all
- [SW4–GigabitEthernet0/0/1]quit
- [SW6]vlan 88 #添加 VLAN 88
- [SW6–vlan88]quit
- [SW6]interface gi0/0/24 #连接SW5
- [SW6–GigabitEthernet0/0/24]port link–type trunk
- [SW6–GigabitEthernet0/0/24]port trunk allow–pass vlan all
- [SW6–GigabitEthernet0/0/24]quit[/hidecontent]