hcia实验
1. 使用172.16.0.0/16划分网络
使用子网掩码 255.255.255.0 划分172.16.0.0/16网段
划分为
172.16.1.0/24
172.16.2.0/24
172.16.3.0/24
172.16.4.0/24
2.使用ospf协议合理规划区域保证更新安全
[R4]ospf 100 router-id 4.4.4.4 配置进程和router-id
[R4-ospf-100]area 0 将路由器接口划入区域
[R4-ospf-100-area-0.0.0.0]network 0.0.0.0 (需要宣告的接口IP) 255.255.255.255
( 11111111.11111111.1111111.11111111 00000000.00000000.00000000.0000000
反掩码里面0表示关注,1表示不关注) 宣告
3.加快收敛速度
[R2]interface g0/0/0
[R2-GigabitEthernet0/0/0]ospf timer hello 5
[R2-GigabitEthernet0/0/0]ospf timer dead 20(默认ospf自动4倍匹配)
4. router1为DR没有BDR
Ospf中的DR和BDR的选举规则
1.先比较优先级 越大越优
2.比较router-id 越大越优
3.非抢占性
修改优先级
默认优先级都是一
0 表示不参选
[R2]interface g0/0/0
[R2-GigabitEthernet0/0/0]ospf dr-priority 0
重启ospf进程
[R2]reset ospf process
将区域0内除了R1以外所有接口优先级修改为0
5.pc2345自动获取ip地址,pc1为外网pc要求可以互相访问
虚拟子接口
[Huawei]interface g0/0/0.1
[Huawei-GigabitEthernet0/0/0.1]dot1q termination vid 2 划入vlan2
[Huawei-GigabitEthernet0/0/0.1]ip address 192.168.1.1 24
打开DHCP
[R1]dhcp enable
[Huawei]ip pool 2
Info: It’s successful to create an IP address pool.
[Huawei-ip-pool-2]network 192.168.1.0 mask 255.255.255.0
[Huawei-ip-pool-2]gateway-list 192.168.1.1
[Huawei-ip-pool-2]dns-list 8.8.8.8
[Huawei-ip-pool-2]quit
[Huawei]interface g0/0/0.1
[Huawei-GigabitEthernet0/0/0.1]dhcp select global
[Huawei-GigabitEthernet0/0/0.1]arp broadcast enable
PC2 PING PC4
6 .router6为运营商只能配置ip地址
内网可以ping通外网
写一条通往外网的缺省
[5]ip route-static 0.0.0.0 0.0.0.0 10.1.1.2 未知网段 未知网段子网掩码 下一跳IP
下放缺省路由
[5]ospf 100
[5-ospf-100]default-route-advertise 自己本身必须有缺省路由
R6为外网路由器
多对一nat easy nat
抓取感兴趣流量
[R5]acl 2000
[R5-acl-basic-2000]rule permit source any
[R5]interface g0/0/1
[R5-GigabitEthernet0/0/1]nat outbound 2000
9.pc3可以ping通pc5但pc5不能ping通pc3
<4>display acl 3000
Advanced ACL 3000, 2 rulesAcl’s step is 5
rule 5 deny icmp source 192.168.4.254 0 destination 192.168.2.254 0 icmp-type echo (5 matches)
rule 10 permit ip (1135 matches)
7.pc1远程登录router6实际登录router4
8. pc4可以ping通router5但不能登录router5
由于ensp模拟器原因无法配置