ENSP RIP动态路由
RIP(距离矢量路由协议)以网络中所有链路的距离和矢量为依据计算最佳路径,是第一个动态路由协议。条数作为唯一的度量单位。默认开启水平分割(从一个路由接口学到的路由信息,便不在从这个接口发送出去)防止路由环路。
RIP的版本:
RIPv1:30s周期性的更新,采用广播方式更新,使用有类路由(50%丢包率),不携带子网掩码。
RIPv2:触发式更新,采用组播(224.0.0.9)的方式更新,支持无类路由,携带子网掩码。封装在UDP报文中。
RIPng:支持IPV6。
LSW1配置
<Huawei>sy
[Huawei]undo in en
[Huawei]vlan batch 10 20 100
[Huawei]int Vlanif 10 //虚拟的接口,可用来配置vlan的网关//由于三层交换机具有路由功能,而vlanif就提供了路由的功能,vlan将数据发送到对应的vlanif中,由vlanif完成不同网段之间的数据的转发。
[Huawei-Vlanif10]ip address 192.168.10.254 24[Huawei-Vlanif10]int vlanif 20
[Huawei-Vlanif20]ip address 192.168.20.254 24[Huawei-Vlanif20]int vlanif 100
[Huawei-Vlanif100]ip address 192.168.1.1 24
[Huawei-Vlanif100]q
[Huawei]int g0/0/2
[Huawei-GigabitEthernet0/0/2]port link-type access
[Huawei-GigabitEthernet0/0/2]port default vlan 10
[Huawei-GigabitEthernet0/0/2]int g0/0/3
[Huawei-GigabitEthernet0/0/3]port link-type access
[Huawei-GigabitEthernet0/0/3]port default vlan 20
[Huawei-GigabitEthernet0/0/3]int g0/0/1
[Huawei-GigabitEthernet0/0/1]port link-type access
[Huawei-GigabitEthernet0/0/1]port default vlan 100[Huawei-GigabitEthernet0/0/1]q
[Huawei]rip
[Huawei-rip-1]version 2
[Huawei-rip-1]network 192.168.10.0 //通告直连网段
[Huawei-rip-1]network 192.168.20.0
[Huawei-rip-1]network 192.168.1.0
[Huawei-rip-1]q
***trunk模式的切换成access模式
[Huawei-GigabitEthernet0/0/1]undo port trunk allow-pass vlan all
[Huawei-GigabitEthernet0/0/1]port trunk allow-pass vlan 1
[Huawei-GigabitEthernet0/0/1]port link-type access
[Huawei-GigabitEthernet0/0/1]port default vlan 100
***access模式切换成trunk模式
[Huawei-GigabitEthernet0/0/1]port default vlan 1
[Huawei-GigabitEthernet0/0/1]port link-type trunk
[Huawei-GigabitEthernet0/0/1]port trunk allow-pass vlan all
AR1配置
<Huawei>sy
[Huawei]int g0/0/0
[Huawei-GigabitEthernet0/0/0]ip address 192.168.1.2 24
[Huawei-GigabitEthernet0/0/0]int g0/0/1
[Huawei-GigabitEthernet0/0/1]ip address 192.168.2.2 24[Huawei-GigabitEthernet0/0/1]q
[Huawei]rip
[Huawei-rip-1]version 2
[Huawei-rip-1]network 192.168.1.0
[Huawei-rip-1]network 192.168.2.0
[Huawei-rip-1]q
AR2配置
<Huawei>sy
[Huawei]int g0/0/0[Huawei-GigabitEthernet0/0/0]ip address 192.168.2.1 24
[Huawei-GigabitEthernet0/0/0]int g0/0/1
[Huawei-GigabitEthernet0/0/1]ip address 192.168.30.254 24[Huawei]rip
[Huawei-rip-1]version 2
[Huawei-rip-1]network 192.168.2.0
[Huawei-rip-1]network 192.168.30.0
[Huawei-rip-1]q
测试联通性