迈普MENE(13800¥)
OSPF
小例子
R3的配置命令参考:
R3(config-if-gigabitethernet0/0)#ip address 20.0.0.3 24
R3(config-if-gigabitethernet0/1)#ip address 192.168.2.254 24
R3(config)#router ospf 1
R3(config-ospf)#network 20.0.0.0 0.0.0.255 area 1
R3(config-ospf)#network 192.168.2.0 0.0.0.255 area 1
结果
主机一能ping通主机二
实例
R3的配置命令参考
R3(config-if-gigabitethernet0/0)#ip address 2.2.2.3 24
R3(config-if-gigabitethernet0/1)#ip address 4.4.4.3 24
R3(config)#router ospf 1
R3(config-ospf)#network 2.2.2.0 0.0.0.255 area 0
R3(config-ospf)#network 4.4.4.0 0.0.0.255 area 0
----------------------------------------------完事儿----------------------------------------------------
终极实验
SW4的配置命令:
vlan 10,20
int g0/3-0/4
switchport mode trunk
switchport trunk allowed vlan add 10,20
switchport mode access
switchport access vlan 10
switchport mode access
switchport access vlan 20
spanning-tree mst instance 0 priority 32678
spanning-tree enable
SW1的配置命令:
int g0/1-0/2
switchport mode trunk
switchport trunk allowed vlan add 10,20
int vlan 10
ip address 192.169.10.252 24
int vlan 20
ip address 192.168.10.252 24
spanning-tree enable
spanning-tree mst instance 0 priority 4096
int vlan 10
vrrp 10 ip 192.169.10.254
vrrp 10 priority 200
int vlan 20
vrrp 20 ip 192.168.10.254
vrrp 20 priority 200
SW2的配置命令:
int g0/1-0/2
switchport mode trunk
switchport trunk allowed vlan add 10,20
int vlan 10
ip address 192.169.10.253 24
int vlan 20
ip address 192.168.10.253 24
spanning-tree mst instance 0 priority 8192
spanning-tree enable
int vlan 10
vrrp 10 ip 192.169.10.254
vrrp 10 priority 150
int vlan 20
vrrp 20 priority 150
SW3的配置命令:
int g0/1
no switchport
ip address 6.6.6.3 24
int g0/2
no switchport
ip address 7.7.7.3 24
router ospf 1
network 6.6.6.0 0.0.0.255 area 0
network 7.7.7.0 0.0.0.255 area 0
vlan 100,200
int g0/3
switchport mode access
switchport access vlan 100
int vlan 100
ip address 192.169.1.254 24
int g0/4
switchport access vlan 200
int vlan 200
ip address 192.168.1.254 24
RT2的配置命令:
int g0/0
ip address 5.5.5.1 24
int g0/1
ip address 2.2.2.2 24
int g02
ip address 3.3.3.2 24
router ospf 1
network 2.2.2.0 0.0.0.255 area 0
network 3.3.3.0 0.0.0.255 area 0
RT3的配置命令:
int g0/3
ip address 1.1.1.3 24
int g0/4
ip address 2.2.2.4 24
router ospf 1
network 2.2.2.0 0.0.0.255 area 0
network 1.1.1.0 0.0.0.255 area 0
结果
RT2的验证:
RT3的验证:
PC1的验证:
PC2的验证: