HCIA,ospf的实验

 配置路由ip

r1

[Huawei]sysname R1
 
[R1]interface G0/0/0
[R1-GigabitEthernet0/0/0]IP address 192.168.1.1 24
 
[R1]interface G0/0/1
[R1-GigabitEthernet0/0/1]ip address 172.16.1.1 24
 
[R1]interface g0/0/2
[R1-GigabitEthernet0/0/2]ip address 12.1.1.1 24

r2

<R2>system-view 
 
[R2]interface g0/0/0
[R2-GigabitEthernet0/0/0]ip address 12.1.1.2 24
 
[R2]interface g0/0/1
[R2-GigabitEthernet0/0/1]ip address 23.1.1.1 24

r3

[Huawei]sysname R3
 
[R3]interface G0/0/0
[R3-GigabitEthernet0/0/0]IP address 23.1.1.2 24
 
[R3]interface G0/0/1
[R3-GigabitEthernet0/0/1]IP address 123.1.1.1 24

r4

 
[Huawei]sysname R4
 
[R4]interface G0/0/0
[R4-GigabitEthernet0/0/0]ip address 123.1.1.4 24
 
[R4]interface  G0/0/1
[R4-GigabitEthernet0/0/1]IP address 45.1.1.1 24

r5

[Huawei]sysname R5
 
[R5]interface G0/0/0
[R5-GigabitEthernet0/0/0]IP address 123.1.1.3 24
 
[R5]interface G0/0/1
[R5-GigabitEthernet0/0/1]IP address 56.1.1.1 24
 
[R5]interface G0/0/2
[R5-GigabitEthernet0/0/2]IP address 45.1.1.2 24

r6

[R6]sysname R6
 
[R6]interface G0/0/0
[R6-GigabitEthernet0/0/0]ip address 123.1.1.2 24
 
[R6]interface G0/0/1
[R6-GigabitEthernet0/0/1]ip address 56.1.1.2 24

配置hdcp绑定ip

[R1]DHCP enable 
[R1]ip pool aaa
[R1-ip-pool-aaa]network 192.168.1.0 mask 24
[R1-ip-pool-aaa]gateway-list 192.168.1.1
[R1-ip-pool-aaa]dns-list 8.8.8.8 114.114.114.114
[R1-ip-pool-aaa]static-bind ip-address 192.168.1.11 mac-address 5489-9865-065C
[R1-ip-pool-aaa]static-bind ip-address 192.168.1.22 mac-address 5489-9820-09FA
[R1]interface g0/0/0
[R1-GigabitEthernet0/0/0]dhcp select global 
[R1]ip pool aa
[R1-ip-pool-a]network 172.16.1.0 mask 16
[R1-ip-pool-aa]gateway-list 172.16.1.1
[R1-ip-pool-aa]dns-list 8.8.8.8 114.114.114.114
[R1-ip-pool-aa]static-bind ip-address 172.16.1.11 mac-address 5489-9899-6DA3
[R1-ip-pool-aa]static-bind ip-address 172.16.1.22 mac-address 5489-98AA-13A6
[R1]interface g0/0/1
[R1-GigabitEthernet0/0/1]dhcp select global 

创建环回,打开ospf

[R1]interface loopback0
[R1-LoopBack0]ip address 1.1.1.1
[R1-LoopBack0]ospf
[R1-ospf-1]area 1
[R1-ospf-1-area-0.0.0.1]network 1.1.1.1 0.0.0.0
[R1-ospf-1-area-0.0.0.1]network 12.1.1.0 0.0.0.255
[R1-ospf-1-area-0.0.0.1]network 192.168.1.0 0.0.0.255
[R1-ospf-1-area-0.0.0.1]network 172.16.1.0 0.0.0.255
[R2]interface LoopBack 0
[R2-LoopBack0]ip address 2.2.2.2 32
[R2-LoopBack0]ospf
[R2-ospf-1]area 1
[R2-ospf-1-area-0.0.0.1]network 2.2.2.2 0.0.0.0
[R2-ospf-1-area-0.0.0.1]network 12.1.1.0 0.0.0.255
[R2-ospf-1-area-0.0.0.1]network 23.1.1.0 0.0.0.255
[R3]interface LoopBack 0	
[R3-LoopBack0]ip address 3.3.3.3 32
[R3-LoopBack0]ospf
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]network 3.3.3.3 0.0.0.0
[R3-ospf-1-area-0.0.0.0]network 23.1.1.0 0.0.0.255
[R3-ospf-1-area-0.0.0.0]network 123.1.1.0 0.0.0.255
[R4]interface LoopBack 0
[R4-LoopBack0]ip address 4.4.4.4 255.255.255.255
[R4-LoopBack0]ospf
[R4-ospf-1]area 2
[R4-ospf-1-area-0.0.0.2]network 4.4.4.4 0.0.0.0
[R4-ospf-1-area-0.0.0.2]network 123.1.1.0 0.0.0.255
[R4-ospf-1-area-0.0.0.2]network 45.1.1.0 0.0.0.255
[R5]interface LoopBack 0
[R5-LoopBack0]ip address 5.5.5.5 255.255.255.255
[R5-LoopBack0]ospf
[R5-ospf-1]area 2
[R5-ospf-1-area-0.0.0.2]network 5.5.5.5 0.0.0.0
[R5-ospf-1-area-0.0.0.2]network 123.1.1.0 0.0.0.255
[R5-ospf-1-area-0.0.0.2]network 45.1.1.0 0.0.0.255
[R5-ospf-1-area-0.0.0.2]network 56.1.1.0 0.0.0.255
[R6]interface LoopBack 0
[R6-LoopBack0]ip address 6.6.6.6 255.255.255.255
[R6-LoopBack0]ospf
[R6-ospf-1]area 2
[R6-ospf-1-area-0.0.0.2]network 6.6.6.6 0.0.0.0
[R6-ospf-1-area-0.0.0.2]network 123.1.1.0 0.0.0.255
[R6-ospf-1-area-0.0.0.2]network 56.1.1.0 0.0.0.255

配置只有r3为dr,无bdr

 
[R4]interface g0/0/0
[R4-GigabitEthernet0/0/0]ospf dr-priority 0
 
[R5]interface g0/0/0	
[R5-GigabitEthernet0/0/0]ospf dr-priority 0
[R6]interface g0/0/0	
[R6-GigabitEthernet0/0/0]ospf dr-priority 0

配置r4缺省

[R4]ospf 
[R4-ospf-1]default-route-advertise always 

明文认证

[R1]interface g0/0/2
[R1-GigabitEthernet0/0/2]ospf authentication-mode simple cipher 666


[R2]interface g0/0/0
[R2-GigabitEthernet0/0/0]ospf authentication-mode simple cipher 666


[R2]interface g0/0/1
[R2-GigabitEthernet0/0/1]ospf authentication-mode simple cipher 666


[R3]interface g0/0/0
[R3-GigabitEthernet0/0/0]ospf authentication-mode simple cipher 666

密文认证

[R4]interface G0/0/1
[R4-GigabitEthernet0/0/1]ospf  
[R4-GigabitEthernet0/0/1]ospf authentication-mode simple cipher 666
[R4-GigabitEthernet0/0/1]ospf authentication-mode md5
[R5]interface g0/0/1
[R5-GigabitEthernet0/0/1]ospf authentication-mode simple cipher 666
[R5-GigabitEthernet0/0/1]ospf authentication-mode md5
[R5]interface g0/0/02
[R5-GigabitEthernet0/0/2]ospf   
[R5-GigabitEthernet0/0/2]ospf authentication-mode simple cipher 666
[R5-GigabitEthernet0/0/2]ospf authentication-mode md5
[R6]interface g0/0/1
[R6-GigabitEthernet0/0/1]ospf authentication-mode simple cipher 666
[R6-GigabitEthernet0/0/1]ospf authentication-mode md5

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值