一:链路聚合概述 是将多个物理接口当作一个逻辑接口,以增加带宽和提供线路冗余。 成员接口:是将加入Eth-Trunk时注意以下问题 (1)每个Eth-Trunk接口最多可以包含8个成员接口 (2)成员接口不能单独配置任何功能和静态MAC地址 (3)成员接口加入Eth-Trunk时,必须为默认的hybrid类型接口 (4)Eth-trunk接口不能嵌套,即成员接口不能是Eth-trunk (5)一个以太网接口中的成员接口必须是同一类型,即FE口和GE口不能加入同一个Eth-trunk接口 (6)可以将不同接口板上的以太网加入到同一个Eth-trunk (7)如果本地设备使用了Eth-trunk,与成员接口直连的对端接口也必须捆绑为Eth-trunk接口这样两端才能正常通信 (8)当成员接口的速率不一致时,实际使用中速率小的接口可能出现拥塞,导致丢包 (9)当成员接口加入到Eth-trunk后,学习MAC地址时按照Eth-trunk来学习的,而不时按照成员接口来学习的 二:链路聚合模式 手工负载分担模式和静态LACP模式
主动端与被动端 在静态LACP模式下,聚合组俩段的设备中,需要选择一端为主动端,而另外一端为被动端,通常情况下,LACP优先级较高的一端为主动端,如果优先级一样,那么就选MAC地址小的一端为主动端 三:实验拓扑图 ip自行配置 (1)sw4,sw5,sw6,sw7,sw3的vlan和trunk的配置: 这里用sw4为例: [sw4]vlan batch 2 to 6 //创建2,3,4,5vlan [sw4]int g0/0/1 [sw4-GigabitEthernet0/0/1]port link-type trunk //打开中继链路 [sw4-GigabitEthernet0/0/1]port trunk allow-pass vlan all [sw4-GigabitEthernet0/0/1]quit [sw4]int g0/0/3 [sw4-GigabitEthernet0/0/3]port link-type access [sw4-GigabitEthernet0/0/3]port default vlan 2 [sw4-GigabitEthernet0/0/3]quit [sw4]int g0/0/2 [sw4-GigabitEthernet0/0/2]port link-type access [sw4-GigabitEthernet0/0/2]port default vlan 3 [sw4-GigabitEthernet0/0/2]quit 查看vlan信息:display vlan (2)sw1和sw2上vlan,trunk,lacp配置: lacp配置(sw1): [sw1]lacp priority 1000 [sw1]int Eth-Trunk 12 [sw1-Eth-Trunk12]mode lacp-static [sw1-Eth-Trunk12]load-balance dst-mac [sw1-Eth-Trunk12]trunkport GigabitEthernet 0/0/23 [sw1-Eth-Trunk12]trunkport GigabitEthernet 0/0/24 [sw1-Eth-Trunk12]quit (3)vlan间配置: [sw1]vlan batch 2 to 9 [sw1]interface Eth-Trunk 12 [sw1-Eth-Trunk12]port link-type trunk [sw1-Eth-Trunk12]port trunk allow-pass vlan all [sw1-Eth-Trunk12]quit [sw1]int g0/0/2 [sw1-GigabitEthernet0/0/2]port link-type trunk [sw1-GigabitEthernet0/0/2]port trunk allow-pass vlan all [sw1-GigabitEthernet0/0/2]quit
[sw1]int g0/0/3 [sw1-GigabitEthernet0/0/3]port link-type trunk [sw1-GigabitEthernet0/0/3]port trunk allow-pass vlan all [sw1-GigabitEthernet0/0/3]quit
[sw1]int g0/0/1 [sw1-GigabitEthernet0/0/1]port link-type access [sw1-GigabitEthernet0/0/1]port default vlan 7 [sw1-GigabitEthernet0/0/1]quit
interface Vlanif 2 ip address 192.168.2.1 255.255.255.0
interface Vlanif 3 ip address 192.168.3.1 255.255.255.0
interface Vlanif 4 ip address 192.168.4.1 255.255.255.0
interface Vlanif 7 ip address 192.168.7.1 255.255.255.0
(3)acp配置(sw2): [sw2]int Eth-Trunk 12 [sw2-Eth-Trunk12]mode lacp-static [sw2-Eth-Trunk12]trunkport GigabitEthernet 0/0/23 [sw2-Eth-Trunk12]trunkport GigabitEthernet 0/0/24 [sw2-Eth-Trunk12]quit
vlan间配置: [sw2]vlan batch 2 to 9 [sw2]interface Eth-Trunk 12 [sw2-Eth-Trunk12]port link-type trunk [sw2-Eth-Trunk12]port trunk allow-pass vlan all [sw2-Eth-Trunk12]quit
[sw2]int g0/0/2 [sw2-GigabitEthernet0/0/2]port link-type trunk [sw2-GigabitEthernet0/0/2]port trunk allow-pass vlan all [sw2-GigabitEthernet0/0/2]quit
[sw2]int g0/0/3 [sw2-GigabitEthernet0/0/3]port link-type trunk [sw2-GigabitEthernet0/0/3]port trunk allow-pass vlan all [sw2-GigabitEthernet0/0/3]quit
[sw2]int g0/0/1 [sw2-GigabitEthernet0/0/1]port link-type access [sw2-GigabitEthernet0/0/1]port default vlan 8 [sw2-GigabitEthernet0/0/1]quit
interface Vlanif 5 ip address 192.168.5.1 255.255.255.0
interface Vlanif 6 ip address 192.168.6.1 255.255.255.0
interface Vlanif 8 ip address 192.168.8.1 255.255.255.0
ospf 的配置: 分别在R2,SW1,SW2配置ospf R2: 配置IP地址略 配置ospf: [R2]ospf 110 [R2-ospf-110]area 0 [R2-ospf-110-area-0.0.0.0]network 192.168.7.0 0.0.0.255 [R2-ospf-110-area-0.0.0.0]network 192.168.8.0 0.0.0.255 [R2-ospf-110-area-0.0.0.0]quit [R2-ospf-110]quit
SW1的OSPF配置 ospf 110 area 0 network 192.168.7.0 0.0.0.255 network 192.168.2.0 0.0.0.255 network 192.168.3.0 0.0.0.255 network 192.168.4.0 0.0.0.255 network 192.168.9.0 0.0.0.255 quit quit
SW2的ospf配置: ospf 110 area 0 network 192.168.8.0 0.0.0.255 network 192.168.9.0 0.0.0.255 network 192.168.5.0 0.0.0.255 network 192.168.6.0 0.0.0.255 quit quit
查看ospf学习达到路由表: display ospf routing
4、单臂路由配置 SW3配置: [sw3]vlan batch 10 to 11 int g0/0/1 port link-type trunk port trunk allow-pass vlan all quit
int g0/0/2 port link-type access port default vlan 10 quit
int g0/0/3 port link-type access port default vlan 11 quit
R4的单臂路由配置: int G0/0/0.10 dot1q termination vid 10 ip address 192.168.10.1 255.255.255.0 arp broadcast enable int G0/0/0.11 dot1q termination vid 11 ip address 192.168.11.1 255.255.255.0 arp broadcast enable
5、Rip的配置
分别R2,R3,R4上配置rip:
如:R3
rip
undo summary
version 2
network 192.168.12.0
network 192.168.13.0
6、配置路由器重分发 在R2上配置: [R2]ospf 110 [R2-ospf-110]import-route rip 1 [R2-ospf-110]rip [R2-rip-1]import-route ospf 110 [R2-rip-1]quit
查看路由表: display ip routing-table
查看接口配置IP地址: display ip interface brief
7、配置NAT及访问控制 在R2上配置: (1)配置默认路由去往internet ip route-static 0.0.0.0 0.0.0.0 200.0.0.2
(2)默认路由重分发 [R2]ospf 110 [R2-ospf-110]default-route-advertise [R2-ospf-110]quit
[R2]rip [R2-rip-1]default-route originate [R2-rip-1]quit
(3)配置PAT实现内网能访问internet [R2]nat address-group 1 200.0.0.100 200.0.0.100 [R2]acl 2000 [R2-acl-basic-2000]rule 0 permit source any [R2-acl-basic-2000]quit [R2]int g3/0/0 [R2-GigabitEthernet3/0/0]nat outbound 2000 address-group 1 [R2-GigabitEthernet3/0/0]quit
(4)配置静态NAT,将2.10服务器发布到internet。 [R2] int g3/0/0 [R2-GigabitEthernet3/0/0]nat server global 200.0.0.200 inside 192.168.2.10 [R2-GigabitEthernet3/0/0]quit
(5)ACL控制192.168.10.0网段不能访问internet
acl 3000
rule 0 deny ip source 192.168.10.0 0.0.0.255 destination 200.0.0.0 0.0.0.255
rule 5 deny ip source 192.168.10.0 0.0.0.255 destination 201.0.0.0 0.0.0.255
[R2]int g0/0/2 [R2-GigabitEthernet0/0/2]traffic-filter inbound acl 3000 [R2-GigabitEthernet0/0/2]quit
查看NAT转换条目:display nat session all 查看ACL信息: display acl all 查看ospf邻居信息: display ospf peer brief