- 链路聚合配置
SW1
vlan batch 10 20
#
interface Eth-Trunk1
port link-type trunk
port trunk allow-pass vlan 2 to 4094
mode lacp-static
#
interface Ethernet0/0/1
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
interface Ethernet0/0/2
port link-type access
port default vlan 10
#
interface Ethernet0/0/3
port link-type access
port default vlan 10
#
interface Ethernet0/0/4
eth-trunk 1
#
interface Ethernet0/0/5
eth-trunk 1
SW2
#
vlan batch 10 20
#
interface Eth-Trunk1
port link-type trunk
port trunk allow-pass vlan 2 to 4094
mode lacp-static
#
interface Ethernet0/0/1
eth-trunk 1
#
interface Ethernet0/0/2
eth-trunk 1
#
interface Ethernet0/0/3
port link-type access
port default vlan 20
#
interface Ethernet0/0/4
port link-type access
port default vlan 20
#
<SW2>dis eth-trunk
Eth-Trunk1's state information is:
Local:
LAG ID: 1 WorkingMode: STATIC
Preempt Delay: Disabled Hash arithmetic: According to SIP-XOR-DIP
System Priority: 32768 System ID: 4c1f-ccd5-1a6d
Least Active-linknumber: 1 Max Active-linknumber: 8
Operate status: up Number Of Up Port In Trunk: 2
--------------------------------------------------------------------------------
ActorPortName Status PortType PortPri PortNo PortKey PortState Weight
Ethernet0/0/1 Selected 100M 32768 2 289 10111100 1
Ethernet0/0/2 Selected 100M 32768 3 289 10111100 1
Partner:
--------------------------------------------------------------------------------
ActorPortName SysPri SystemID PortPri PortNo PortKey PortState
Ethernet0/0/1 32768 4c1f-cc75-4e7a 32768 5 289 10111100
Ethernet0/0/2 32768 4c1f-cc75-4e7a 32768 6 289 10111100
- OSPF配置
R1
interface GigabitEthernet0/0/0
ip address 12.0.0.1 255.255.255.0
#
interface GigabitEthernet0/0/1
#
interface GigabitEthernet0/0/1.1
dot1q termination vid 10
ip address 192.168.1.254 255.255.255.0
arp broadcast enable
#
interface GigabitEthernet0/0/1.2
dot1q termination vid 20
ip address 192.168.2.254 255.255.255.0
arp broadcast enable
#
interface LoopBack0
ip address 1.1.1.1 255.255.255.255
#
ospf 1 router-id 1.1.1.1
silent-interface GigabitEthernet0/0/1
area 0.0.0.2
network 12.0.0.0 0.0.0.255
network 192.168.1.0 0.0.0.255
network 192.168.2.0 0.0.0.255
R2
interface GigabitEthernet0/0/0
ip address 12.0.0.2 255.255.255.0
#
interface GigabitEthernet0/0/1
ip address 23.0.0.1 255.255.255.0
#
interface LoopBack0
ip address 2.2.2.2 255.255.255.255
#
ospf 1 router-id 2.2.2.2
area 0.0.0.0
network 23.0.0.0 0.0.0.255
area 0.0.0.2
network 12.0.0.0 0.0.0.255
R3
interface GigabitEthernet0/0/0
ip address 23.0.0.2 255.255.255.0
#
interface GigabitEthernet0/0/1
ip address 34.0.0.1 255.255.255.0
#
interface GigabitEthernet0/0/2.1
dot1q termination vid 30
ip address 192.168.3.254 255.255.255.0
arp broadcast enable
#
interface GigabitEthernet0/0/2.2
dot1q termination vid 40
ip address 192.168.4.254 255.255.255.0
arp broadcast enable
#
interface LoopBack0
ip address 3.3.3.3 255.255.255.255
#
ospf 1 router-id 3.3.3.3
area 0.0.0.0
network 23.0.0.0 0.0.0.255
area 0.0.0.1
network 34.0.0.0 0.0.0.255
area 0.0.0.3
network 192.168.3.0 0.0.0.255
network 192.168.4.0 0.0.0.255
R4
interface GigabitEthernet0/0/0
ip address 34.0.0.2 255.255.255.0
#
interface GigabitEthernet0/0/1
ip address 45.0.0.1 255.255.255.0
interface LoopBack0
ip address 4.4.4.4 255.255.255.255
#
ospf 1 router-id 4.4.4.4
default-route-advertise always //注入默认路由
import-route rip 1 //ospf中注入rip
area 0.0.0.1
network 34.0.0.0 0.0.0.255
#
rip 1
version 2
network 45.0.0.0
import-route ospf 1 //rip中注入sopf
R5
interface GigabitEthernet0/0/0
ip address 45.0.0.2 255.255.255.0
#
interface GigabitEthernet0/0/1
ip address 56.0.0.1 255.255.255.0
#
rip 1
default-route originate //注入默认路由
version 2
network 45.0.0.0
network 56.0.0.0
#
ip route-static 0.0.0.0 0.0.0.0 56.0.0.2 //默认路由
R6
#
acl number 2000
rule 5 permit //规则,放通所有
#
interface GigabitEthernet0/0/0
ip address 56.0.0.2 255.255.255.0
#
interface GigabitEthernet0/0/1
ip address 100.1.1.254 255.255.255.0
nat outbound 2000 //放通所有的ip地址转换为接口的IP地址(easy ip)
#
rip 1
version 2
network 56.0.0.0
- 验证全网互通