华为综合案例
S1和S2配置链路聚合:
- 链路聚合(LACP):等同于思科的以太网通道
把多个(最多8个)物理接口合并成一个逻辑接口(eth-trunk),增加带宽和增强线路冗余性,
适用于汇聚网络或核心网络.- 链路聚合接口注意事项
最多8个
成员接口不能单独配置其他功能
单个接口只能加入一个eth-trunk
成员接口类型必须一致(全为F,或全G,或全T)- 链路聚合模式
手工负载分担
静态LACP- 活动接口和非活动接口
手工模式:所有接口都为活动,正常转发数据
静态LACP:设置M:N值,M为活动接口数–转发数据,N为非活动接口数–容错备份- 主动端与被动端
静态LACP模式下,双方交换机优先级高者(值小者优先)占据主动,低者顺从主动设备的配置- 负载均衡模式:
dst-ip
dst-mac
src-ip
src-mac
src-dst-ip
src-dst-mac
实验
关闭消息提示
sys
undo info enable
配置S1和S2的链路聚合
[S1]lacp priority 1000 //配置S1设备的系统LACP优先级
[S1]int Eth-Trunk 12 //创建链路聚合逻辑接口,名称为Eth-Trunk 12
[S1-Eth-Trunk12]mode lacp-static //配置静态LACP模式
[S1-Eth-Trunk12]load-balance dst-mac //配置负载均衡模式为MAC地址
[S1-Eth-Trunk12]trunkport g0/0/11 //添加成员接口g/0/0/11
Info: This operation may take a few seconds. Please wait for a moment...done.
[S1-Eth-Trunk12]trunkport g0/0/12 //添加成员接口g/0/0/12
Info: This operation may take a few seconds. Please wait for a moment...done.
[S1-Eth-Trunk12]quit
[S2]int Eth-Trunk 12
[S2-Eth-Trunk12]mode lacp-static
[S2-Eth-Trunk12]trunkport g0/0/11
Info: This operation may take a few seconds. Please wait for a moment...done.
[S2-Eth-Trunk12]trunkport g0/0/12
Info: This operation may take a few seconds. Please wait for a moment...done.
[S2-Eth-Trunk12]quit
配置VLAN间路由
[S1]vlan batch 11 to 14 1000 to 1002 //批量创建VLAN 11-14、VLAN 1000-1002
Info: This operation may take a few seconds. Please wait for a moment...done.
[S1]int Eth-Trunk 12 //进入链路聚合接口
[S1-Eth-Trunk12]port link-type trunk //配置链路聚合接口模式为Trunk
[S1-Eth-Trunk12]port trunk allow-pass vlan 11 to 14 1000 to 1002
[S1-Eth-Trunk12]int g0/0/21
[S1-GigabitEthernet0/0/21]port link-type trunk //链路聚合接口为Trunk
[S1-GigabitEthernet0/0/21]port trunk allow-pass vlan all //允许所有VLAN
[S1-GigabitEthernet0/0/21]int g0/0/22
[S1-GigabitEthernet0/0/22]port link-type trunk
[S1-GigabitEthernet0/0/22]port trunk allow-pass vlan all
#给vlan设ip
[S1-GigabitEthernet0/0/22]int vlanif 11 //进入VLAN 11的虚接口
[S1-Vlanif11]ip add 10.1.11.1 24
[S1-Vlanif11]int vlanif 12
[S1-Vlanif12]ip add 10.1.12.1 24
[S1-Vlanif12]quit
<S2>sys
[S2]vlan batch 11 to 14 1000 to 1002
Info: This operation may take a few seconds. Please wait for a moment...done.
[S2]int Eth-Trunk 12
[S2-Eth-Trunk12]port link-type trunk
[S2-Eth-Trunk12]port trunk allow-pass vlan all
[S2-Eth-Trunk12]int g0/0/23
[S2-GigabitEthernet0/0/23]port link-type trunk
[S2-GigabitEthernet0/0/23]port trunk allow-pass vlan all
[S2-GigabitEthernet0/0/23]int g0/0/24
[S2-GigabitEthernet0/0/24]port link-type trunk
[S2-GigabitEthernet0/0/24]port trunk allow-pass vlan all
[S2-GigabitEthernet0/0/24]int vlanif 13
[S2-Vlanif13]ip address 10.1.13.1 24
[S2-Vlanif13]int vlanif 14
[S2-Vlanif14]ip address 10.1.14.1 24
S3、S4、S5、S6做Trunk口,加入VLAN
[S3]vlan batch 11 to 14
Info: This operation may take a few seconds. Please wait for a moment...done.
[S3]int g0/0/1
[S3-GigabitEthernet0/0/1]port link-type trunk
[S3-GigabitEthernet0/0/1]port trunk allow-pass vlan all
#加入VLAN
[S3-GigabitEthernet0/0/1]int g0/0/2
[S3-GigabitEthernet0/0/2]port link-type access //配置端口模式为access
[S3-GigabitEthernet0/0/2]port default vlan 11 //接口加入VLAN 11
[S3-GigabitEthernet0/0/2]quit
[S4]vlan batch 11 to 14
Info: This operation may take a few seconds. Please wait for a moment...done.
[S4]int g0/0/1
[S4-GigabitEthernet0/0/1]port link-type trunk
[S4-GigabitEthernet0/0/1]port trunk allow-pass vlan all
[S4-GigabitEthernet0/0/1]int g0/0/2
[S4-GigabitEthernet0/0/2]port link-type access
[S4-GigabitEthernet0/0/2]port default vlan 12
[S4-GigabitEthernet0/0/2]quit
[S5]vlan batch 11 to 14
Info: This operation may take a few seconds. Please wait for a moment...done.
[S5]int g0/0/1
[S5-GigabitEthernet0/0/1]port link-type trunk
[S5-GigabitEthernet0/0/1]port trunk allow-pass vlan all
[S5-GigabitEthernet0/0/1]int g0/0/2
[S5-GigabitEthernet0/0/2]port link-type access
[S5-GigabitEthernet0/0/2]port default vlan 13
[S5-GigabitEthernet0/0/2]quit
[S6]vlan batch 11 to 14
Info: This operation may take a few seconds. Please wait for a moment...done.
[S6]int g0/0/24
[S6-GigabitEthernet0/0/24]port link-type trunk
[S6-GigabitEthernet0/0/24]port trunk allow-pass vlan all
[S6-GigabitEthernet0/0/24]int g0/0/1
[S6-GigabitEthernet0/0/1]port link-type access
[S6-GigabitEthernet0/0/1]port default vlan 14
[S6-GigabitEthernet0/0/1]quit
配置R4的单臂路由
[R4]int g0/0/0.21 //进入子接口
[R4-GigabitEthernet0/0/0.21]ip add 10.1.21.1 24 //配置子接口IP地址
[R4-GigabitEthernet0/0/0.21]dot1q termination vid 21 //子接口和VLAN 21关联
[R4-GigabitEthernet0/0/0.21]arp broadcast enable //子接口打开ARP广播
[R4-GigabitEthernet0/0/0.21]int g0/0/0.22
[R4-GigabitEthernet0/0/0.22]ip add 10.1.22.1 24
[R4-GigabitEthernet0/0/0.22]dot1q termination vid 22
[R4-GigabitEthernet0/0/0.22]arp broadcast enable
[R4-GigabitEthernet0/0/0.22]quit
[S7]vlan batch 21 22
Info: This operation may take a few seconds. Please wait for a moment...done.
[S7]int g0/0/10
[S7-GigabitEthernet0/0/10]port link-type trunk
[S7-GigabitEthernet0/0/10]port trunk allow-pass vlan all
[S7-GigabitEthernet0/0/10]int g0/0/1
[S7-GigabitEthernet0/0/1]port link-type access
[S7-GigabitEthernet0/0/1]port default vlan 21
[S7-GigabitEthernet0/0/1]int g0/0/2
[S7-GigabitEthernet0/0/2]port link-type access
[S7-GigabitEthernet0/0/2]port default vlan 22
S1、S2做OSPF
[S1]int g0/0/1
[S1-GigabitEthernet0/0/1]port link-type access
[S1-GigabitEthernet0/0/1]port default vlan 1001 //物理接口加入VLAN 1001
[S1-GigabitEthernet0/0/1]quit
[S1]int vlanif 1000
[S1-Vlanif1000]ip add 10.1.122.11 24
[S1-Vlanif1000]int vlanif 1001 //配置VLAN 1001的虚接口
[S1-Vlanif1001]ip add 10.1.111.11 24
[S1-Vlanif1001]quit
#做OSPF
[S1]ospf 110 //进入OSPF进程模式,其中110代表进程ID号
[S1-ospf-110]area 0 //和Cisco不同,华为要先进入某个区域,再network宣告网络
[S1-ospf-110-area-0.0.0.0]network 10.1.11.0 0.0.0.255 //宣告网络
[S1-ospf-110-area-0.0.0.0]network 10.1.12.0 0.0.0.255 //不需要跟区域
[S1-ospf-110-area-0.0.0.0]network 10.1.111.0 0.0.0.255
[S1-ospf-110-area-0.0.0.0]network 10.1.122.0 0.0.0.255
[S2]int g0/0/2
[S2-GigabitEthernet0/0/2]port link-type access
[S2-GigabitEthernet0/0/2]port default vlan 1002
[S2-GigabitEthernet0/0/2]int vlanif 1000
[S2-Vlanif1000]ip add 10.1.122.12 24
[S2-Vlanif1000]int vlanif 1002
[S2-Vlanif1002]ip add 10.1.112.12 24
[S2-Vlanif1002]quit
[S2]ospf 110
[S2-ospf-110]area 0
[S2-ospf-110-area-0.0.0.0]network 10.1.13.0 0.0.0.255
[S2-ospf-110-area-0.0.0.0]network 10.1.14.0 0.0.0.255
[S2-ospf-110-area-0.0.0.0]network 10.1.112.0 0.0.0.255
[S2-ospf-110-area-0.0.0.0]network 10.1.122.0 0.0.0.255
[S2-ospf-110-area-0.0.0.0]quit
R2、R3、R4、R5
[R2]int g0/0/0
[R2-GigabitEthernet0/0/0]ip add 10.1.113.1 24
[R2-GigabitEthernet0/0/0]int g0/0/1
[R2-GigabitEthernet0/0/1]ip add 10.1.111.1 24
[R2-GigabitEthernet0/0/1]int g0/0/2
[R2-GigabitEthernet0/0/2]ip add 10.1.112.1 24
#OSPF
[R2-GigabitEthernet0/0/2]ospf 110
[R2-ospf-110]area 0
[R2-ospf-110-area-0.0.0.0]network 10.1.111.0 0.0.0.255
[R2-ospf-110-area-0.0.0.0]network 10.1.112.0 0.0.0.255
[R2-ospf-110-area-0.0.0.0]network 10.1.113.0 0.0.0.255
[R3]int g0/0/0
[R3-GigabitEthernet0/0/0]ip add 10.1.113.3 24
[R3-GigabitEthernet0/0/0]int g0/0/1
[R3-GigabitEthernet0/0/1]ip add 10.1.134.3 24
[R3-GigabitEthernet0/0/1]ospf 110
[R3-ospf-110]area 0
[R3-ospf-110-area-0.0.0.0]network 10.1.113.0 0.0.0.255
[R3-ospf-110-area-0.0.0.0]quit
[R3-ospf-110]quit
[R3]rip
[R3-rip-1]ver 2
[R3-rip-1]undo su
[R3-rip-1]network 10.0.0.0
[R3-rip-1]quit
[R4]int g0/0/1
[R4-GigabitEthernet0/0/1]ip add 10.1.134.4 24
[R4-GigabitEthernet0/0/1]int g0/0/2
[R4-GigabitEthernet0/0/2]ip add 10.1.145.4 24
[R4-GigabitEthernet0/0/2]quit
[R4]rip
[R4-rip-1]ver 2
[R4-rip-1]undo su
[R4-rip-1]network 10.0.0.0
[R4-rip-1]quit
[R5]int g0/0/2
[R5-GigabitEthernet0/0/2]ip add 10.1.145.5 24
[R5-GigabitEthernet0/0/2]int g0/0/0
[R5-GigabitEthernet0/0/0]ip add 10.1.100.1 24
[R5-GigabitEthernet0/0/0]quit
[R5]rip
[R5-rip-1]ver 2
[R5-rip-1]undo su
[R5-rip-1]network 10.0.0.0
[R5-rip-1]quit
R3做路由重分发
[R3]ospf 110 //进入OSPF进程模式
[R3-ospf-110]import-route rip 1 //将RIP协议重分发到OSPF中
[R3-ospf-110]rip //进入RIP进程模式
[R3-rip-1]import ospf 110 //将OSPF协议重分发到RIP中
[R3-rip-1]quit
配置企业边界路由器R2
[R2]int s4/0/0 //进入serial口
[R2-Serial4/0/0]ip add 202.2.12.1 24
[R2-Serial4/0/0]quit
[R2]ip route-static 0.0.0.0 0.0.0.0 202.2.12.2 //配置静态路由
[R2]ospf 110
[R2-ospf-110]default-route-advertise //向OSPF注入默认路由(前提是自己有默认)
#nat地址转换
[R2]nat address-group 1 202.2.12.100 202.2.12.100 //配置NAT组(池)
[R2]acl 2000 //编写编号为2000的ACL
[R2-acl-basic-2000]rule 0 permit source 10.1.0.0 0.0.15.255 //规则为0
[R2-acl-basic-2000]rule 10 permit source 10.1.100.0 0.0.0.255 //规则为10
#配置公网地址
[R2]int s4/0/0
[R2-Serial4/0/0]nat outbound 2000 address-group 1 //NAT转换,2000为ACL;配置NAT映射,将服务器映射为公网地址202.2.12.200
[R2-Serial4/0/0]nat server global 202.2.12.200 inside 10.1.100.100
R1
[R1]int s4/0/0
[R1-Serial4/0/0]ip add 202.2.12.2 24
[R1-Serial4/0/0]int g0/0/0
[R1-GigabitEthernet0/0/0]ip add 202.2.2.1 24
R3
[R3]rip
[R3-rip-1]default-route originate
到此,网络拓扑图就完成了全网通