路由ar1
<Huawei>
<Huawei>u t m
Info: Current terminal monitor is off.
<Huawei>sy
Enter system view, return user view with Ctrl+Z.
[Huawei]int g0/0/0
[Huawei-GigabitEthernet0/0/0]ip add
[Huawei-GigabitEthernet0/0/0]ip address 192.168.1.254 24
[Huawei-GigabitEthernet0/0/0]int g0/0/1
[Huawei-GigabitEthernet0/0/1]ip add
[Huawei-GigabitEthernet0/0/1]ip address 192.168.12.1 24
[Huawei-GigabitEthernet0/0/1]q
[Huawei]ospf ?
INTEGER<1-65535> Process ID
mib-binding Mib-Binding a Process
router-id <Group> router-id command group
valid-ttl-hops Valid GTSM TTL hops
vpn-instance VPN routing/forwarding Instance
<cr> Please press ENTER to execute command
[Huawei]ospf 1 ?
router-id OSPF Private router ID
vpn-instance VPN routing/forwarding Instance
<cr> Please press ENTER to execute command
[Huawei]ospf 1 r
[Huawei]ospf 1 router-id 1.1.1.1 /开启ospf,进程为1,id为1.1.1.1
[Huawei-ospf-1]ar
[Huawei-ospf-1]area ?
INTEGER<0-4294967295> OSPF area ID (Integer)
IP_ADDR<X.X.X.X> OSPF area ID (IP address)
[Huawei-ospf-1]area 0 ?
<cr> Please press ENTER to execute command
[Huawei-ospf-1]area 0 创建0区域并进入
[Huawei-ospf-1-area-0.0.0.0]net
[Huawei-ospf-1-area-0.0.0.0]network 192.168.1.0 0.0.0.255 把路由接口上的网段放入ospf区域0
[Huawei-ospf-1-area-0.0.0.0]net
[Huawei-ospf-1-area-0.0.0.0]network 192.168.12.0 0.0.0.255 //把路由接口上的网段放入ospf区域0
路由ar2
The device is running!
<Huawei>
<Huawei>u t m
Info: Current terminal monitor is off.
<Huawei>sy
Enter system view, return user view with Ctrl+Z.
[Huawei]int g0/0/0
[Huawei-GigabitEthernet0/0/0]ip add
[Huawei-GigabitEthernet0/0/0]ip address 192.168.12.2 24
[Huawei-GigabitEthernet0/0/0]int g0/0/1
[Huawei-GigabitEthernet0/0/1]ip add
[Huawei-GigabitEthernet0/0/1]ip address 192.168.23.2 24
[Huawei-GigabitEthernet0/0/1]q
[Huawei]
<Huawei>sy
Enter system view, return user view with Ctrl+Z.
[Huawei]ospf 1 r
[Huawei]ospf 1 router-id 2.2.2.2
[Huawei-ospf-1]ar
[Huawei-ospf-1]area 0
[Huawei-ospf-1-area-0.0.0.0]ne
[Huawei-ospf-1-area-0.0.0.0]network 192.168.12.0 0.0.0.255
[Huawei-ospf-1-area-0.0.0.0]ne
[Huawei-ospf-1-area-0.0.0.0]network 192.168.23.0 0.0.0.255
路由ar3
The device is running!
####################################
<Huawei>u t m
Info: Current terminal monitor is off.
<Huawei>sy
Enter system view, return user view with Ctrl+Z.
[Huawei]int g0/0/0
[Huawei-GigabitEthernet0/0/0]ip add
[Huawei-GigabitEthernet0/0/0]ip address 192.168.23.3 24
[Huawei-GigabitEthernet0/0/0]int g0/0/1
[Huawei-GigabitEthernet0/0/1]ip add`
[Huawei-GigabitEthernet0/0/1]ip add
[Huawei-GigabitEthernet0/0/1]ip address 192.168.2.254 24
[Huawei-GigabitEthernet0/0/1]
<Huawei>u t m
Info: Current terminal monitor is off.
<Huawei>sy
Enter system view, return user view with Ctrl+Z.
[Huawei]ospf 1 r
[Huawei]ospf 1 router-id 3.3.3.3
[Huawei-ospf-1]a
[Huawei-ospf-1]area 0
[Huawei-ospf-1-area-0.0.0.0]n
[Huawei-ospf-1-area-0.0.0.0]ne
[Huawei-ospf-1-area-0.0.0.0]network 192.168.23.0 0.0.0.255
[Huawei-ospf-1-area-0.0.0.0]net
[Huawei-ospf-1-area-0.0.0.0]network 192.168.2.0 0.0.0.255
ping测试
ar1路由表