User Tools

Site Tools


wikiv2:huawei_route_static

Huawei - Roteamento estático

Cenário

Configuração de IPs

AR1000v1

<Huawei>system-view 
[Huawei]sysname AR1000v1
[AR1000v1]interface GigabitEthernet 0/0/0
[AR1000v1-GigabitEthernet0/0/0]description UPLINK-AR1000v2
[AR1000v1-GigabitEthernet0/0/0]ip address 10.10.10.1 29
[AR1000v1-GigabitEthernet0/0/0]display this
[V300R019C00SPC300]
#
interface GigabitEthernet0/0/0
 description UPLINK-AR1000v2
 ip address 10.10.10.1 255.255.255.248
#
return
[AR1000v1]interface GigabitEthernet 0/0/1
[AR1000v1-GigabitEthernet0/0/1]description UPLINK-AR1000v3
[AR1000v1-GigabitEthernet0/0/1]ip address 30.30.30.1 29
[AR1000v1-GigabitEthernet0/0/1]display this
[V300R019C00SPC300]
#
interface GigabitEthernet0/0/1
 description UPLINK-AR1000v3
 ip address 30.30.30.1 255.255.255.248
#
return
[AR1000v1]interface GigabitEthernet 0/0/3	
[AR1000v1-GigabitEthernet0/0/3]description LAN
[AR1000v1-GigabitEthernet0/0/3]ip address 192.168.1.1 24
[AR1000v1-GigabitEthernet0/0/3]display this
[V300R019C00SPC300]
#
interface GigabitEthernet0/0/3
 description LAN
 ip address 192.168.1.1 255.255.255.0
#
return

AR1000v2

<Huawei>system-view 
[Huawei]interface GigabitEthernet 0/0/0	
[Huawei-GigabitEthernet0/0/0]description UPLINK-AR1000v1
[Huawei-GigabitEthernet0/0/0]ip address 10.10.10.2 29
[Huawei-GigabitEthernet0/0/0]display this
[V300R019C00SPC300]
#
interface GigabitEthernet0/0/0
 description UPLINK-AR1000v1
 ip address 10.10.10.2 255.255.255.248
#
return
[Huawei]interface GigabitEthernet 0/0/2	
[Huawei-GigabitEthernet0/0/2]description UPLINK-AR1000v3
[Huawei-GigabitEthernet0/0/2]ip address 20.20.20.1 29
[Huawei-GigabitEthernet0/0/2]display this
[V300R019C00SPC300]
#
interface GigabitEthernet0/0/2
 description UPLINK-AR1000v3
 ip address 20.20.20.1 255.255.255.248
#
return
[Huawei]interface GigabitEthernet 0/0/3
[Huawei-GigabitEthernet0/0/3]description LAN	
[Huawei-GigabitEthernet0/0/3]ip address 192.168.2.1 24
[Huawei-GigabitEthernet0/0/3]display this
[V300R019C00SPC300]
#
interface GigabitEthernet0/0/3
 description LAN
 ip address 192.168.2.1 255.255.255.0
#
return

AR1000v3

<Huawei>system-view 
[Huawei]sysname AR1000v3
[AR1000v3]interface GigabitEthernet 0/0/1	
[AR1000v3-GigabitEthernet0/0/1]description UPLINK-AR1000v1
[AR1000v3-GigabitEthernet0/0/1]ip address 30.30.30.2 29
[AR1000v3-GigabitEthernet0/0/1]quit
[AR1000v3]interface GigabitEthernet 0/0/2	
[AR1000v3-GigabitEthernet0/0/2]description UPLINK-AR1000v2
[AR1000v3-GigabitEthernet0/0/2]ip address 20.20.20.2 29
[AR1000v3-GigabitEthernet0/0/2]quit
[AR1000v3]interface GigabitEthernet 0/0/3
[AR1000v3-GigabitEthernet0/0/3]description LAN
[AR1000v3-GigabitEthernet0/0/3]ip address 192.168.3.1 24
[AR1000v3-GigabitEthernet0/0/3]quit
[AR1000v3]display ip interface brief 
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
(E): E-Trunk down
The number of interface that is UP in Physical is 8
The number of interface that is DOWN in Physical is 0
The number of interface that is UP in Protocol is 4
The number of interface that is DOWN in Protocol is 4
 
Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              unassigned           up         down      
GigabitEthernet0/0/1              30.30.30.2/29        up         up        
GigabitEthernet0/0/2              20.20.20.2/29        up         up        
GigabitEthernet0/0/3              192.168.3.1/24       up         up        
GigabitEthernet0/0/4              unassigned           up         down      
GigabitEthernet0/0/5              unassigned           up         down      
GigabitEthernet0/0/6              unassigned           up         down      
NULL0                             unassigned           up         up(s) 

Criando as rotas

AR1000v1

[AR1000v1]ip route-static 192.168.2.0 24 10.10.10.2
[AR1000v1]ip route-static 192.168.3.0 24 30.30.30.2
[AR1000v1]display ip routing-table | exclude 127   
Route Flags: R - relay, D - download to fib, T - to vpn-instance
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 15       Routes : 15       
 
Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface
 
     10.10.10.0/29  Direct  0    0           D   10.10.10.1      GigabitEthernet0/0/0
     30.30.30.0/29  Direct  0    0           D   30.30.30.1      GigabitEthernet0/0/1
    192.168.1.0/24  Direct  0    0           D   192.168.1.1     GigabitEthernet0/0/3
    192.168.2.0/24  Static  60   0          RD   10.10.10.2      GigabitEthernet0/0/0
    192.168.3.0/24  Static  60   0          RD   30.30.30.2      GigabitEthernet0/0/1

AR1000v2

[Huawei]ip route-static 192.168.1.0 24 10.10.10.1	
[Huawei]ip route-static 192.168.3.0 24 20.20.20.2
[Huawei]display ip routing-table | exclude 127   
Route Flags: R - relay, D - download to fib, T - to vpn-instance
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 15       Routes : 15       
 
Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface
 
     10.10.10.0/29  Direct  0    0           D   10.10.10.2      GigabitEthernet0/0/0
     20.20.20.0/29  Direct  0    0           D   20.20.20.1      GigabitEthernet0/0/2
    192.168.1.0/24  Static  60   0          RD   10.10.10.1      GigabitEthernet0/0/0
    192.168.2.0/24  Direct  0    0           D   192.168.2.1     GigabitEthernet0/0/3
    192.168.3.0/24  Static  60   0          RD   20.20.20.2      GigabitEthernet0/0/2

AR1000v3

[AR1000v3]ip route-static 192.168.1.0 24 30.30.30.1
[AR1000v3]ip route-static 192.168.2.0 24 20.20.20.1
[AR1000v3]display ip routing-table | exclude 127
Route Flags: R - relay, D - download to fib, T - to vpn-instance
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 15       Routes : 15       
 
Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface
 
     20.20.20.0/29  Direct  0    0           D   20.20.20.2      GigabitEthernet0/0/2
     30.30.30.0/29  Direct  0    0           D   30.30.30.2      GigabitEthernet0/0/1
    192.168.1.0/24  Static  60   0          RD   30.30.30.1      GigabitEthernet0/0/1
    192.168.2.0/24  Static  60   0          RD   20.20.20.1      GigabitEthernet0/0/2
    192.168.3.0/24  Direct  0    0           D   192.168.3.1     GigabitEthernet0/0/3

Testando o acesso

VPC7

VPCS> ip 192.168.1.10 255.255.255.0 192.168.1.1
VPCS> show ip
 
NAME        : VPCS[1]
IP/MASK     : 192.168.1.10/24
GATEWAY     : 192.168.1.1
DNS         : 
MAC         : 00:50:79:66:68:07
LPORT       : 20000
RHOST:PORT  : 127.0.0.1:30000
MTU         : 1500

VPC5

VPCS> ip 192.168.2.10 255.255.255.0 192.168.2.1
VPCS> show ip
 
NAME        : VPCS[1]
IP/MASK     : 192.168.2.10/24
GATEWAY     : 192.168.2.1
DNS         : 
MAC         : 00:50:79:66:68:05
LPORT       : 20000
RHOST:PORT  : 127.0.0.1:30000
MTU         : 1500

VPC6

VPCS> ip 192.168.3.10/24 192.168.3.1
VPCS> show ip                       
 
NAME        : VPCS[1]
IP/MASK     : 192.168.3.10/24
GATEWAY     : 192.168.3.1
DNS         : 
MAC         : 00:50:79:66:68:06
LPORT       : 20000
RHOST:PORT  : 127.0.0.1:30000
MTU         : 1500

Testando o ping

VPCS> ping 192.168.3.1
 
84 bytes from 192.168.3.1 icmp_seq=1 ttl=255 time=0.768 ms
84 bytes from 192.168.3.1 icmp_seq=2 ttl=255 time=0.845 ms
84 bytes from 192.168.3.1 icmp_seq=3 ttl=255 time=1.185 ms
84 bytes from 192.168.3.1 icmp_seq=4 ttl=255 time=0.733 ms
84 bytes from 192.168.3.1 icmp_seq=5 ttl=255 time=0.792 ms
VPCS> ping 192.168.1.10
 
192.168.1.10 icmp_seq=1 timeout
84 bytes from 192.168.1.10 icmp_seq=2 ttl=62 time=21.998 ms
84 bytes from 192.168.1.10 icmp_seq=3 ttl=62 time=3.162 ms
84 bytes from 192.168.1.10 icmp_seq=4 ttl=62 time=2.179 ms
84 bytes from 192.168.1.10 icmp_seq=5 ttl=62 time=2.526 ms
VPCS> ping 192.168.2.10
 
84 bytes from 192.168.2.10 icmp_seq=1 ttl=62 time=16.784 ms
84 bytes from 192.168.2.10 icmp_seq=2 ttl=62 time=2.640 ms
84 bytes from 192.168.2.10 icmp_seq=3 ttl=62 time=2.117 ms
84 bytes from 192.168.2.10 icmp_seq=4 ttl=62 time=2.479 ms
84 bytes from 192.168.2.10 icmp_seq=5 ttl=62 time=2.906 ms

Testando a rota

VPCS> trace 192.168.1.10
trace to 192.168.1.10, 8 hops max, press Ctrl+C to stop
 1   192.168.3.1   20.993 ms  17.006 ms  13.972 ms
 2   30.30.30.1   14.075 ms  16.115 ms  6.067 ms
 3   *192.168.1.10   2.073 ms (ICMP type:3, code:3, Destination port unreachable)
VPCS> trace 192.168.2.10
trace to 192.168.2.10, 8 hops max, press Ctrl+C to stop
 1   192.168.3.1   15.683 ms  20.452 ms  23.075 ms
 2   20.20.20.1   9.973 ms  17.540 ms  14.167 ms
 3   *192.168.2.10   2.243 ms (ICMP type:3, code:3, Destination port unreachable)

Rota redundante

AR1000v1

[AR1000v1]ip route-static 192.168.2.0 24 30.30.30.2 preference 80
[AR1000v1]ip route-static 192.168.3.0 24 10.10.10.2 preference 80

AR1000v2

[Huawei]ip route-static 192.168.1.0 24 20.20.20.2 preference 80
[Huawei]ip route-static 192.168.3.0 24 10.10.10.1 preference 80

AR1000v3

[AR1000v3]ip route-static 192.168.1.0 24 20.20.20.1 preference 80	
[AR1000v3]ip route-static 192.168.2.0 24 30.30.30.1 preference 80

Simulando uma falha

AR1000v1

[AR1000v1]interface GigabitEthernet 0/0/1
[AR1000v1-GigabitEthernet0/0/1]shutdown
[AR1000v1-GigabitEthernet0/0/1]display this 
[V300R019C00SPC300]
#
interface GigabitEthernet0/0/1
 description UPLINK-AR1000v3
 shutdown
 ip address 30.30.30.1 255.255.255.248
#
return
[AR1000v1-GigabitEthernet0/0/1]quit
 
[AR1000v1]display ip routing-table | ex	
[AR1000v1]display ip routing-table | exclude 127
Route Flags: R - relay, D - download to fib, T - to vpn-instance
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 12       Routes : 12       
 
Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface
 
     10.10.10.0/29  Direct  0    0           D   10.10.10.1      GigabitEthernet0/0/0
    192.168.1.0/24  Direct  0    0           D   192.168.1.1     GigabitEthernet0/0/3
    192.168.2.0/24  Static  60   0          RD   10.10.10.2      GigabitEthernet0/0/0
    192.168.3.0/24  Static  80   0          RD   10.10.10.2      GigabitEthernet0/0/0

AR1000v3

AR1000v1]interface GigabitEthernet 0/0/1
[AR1000v1-GigabitEthernet0/0/1]shutdown
[AR1000v1-GigabitEthernet0/0/1]display this 
[V300R019C00SPC300]
#
interface GigabitEthernet0/0/1
 description UPLINK-AR1000v3
 shutdown
 ip address 30.30.30.1 255.255.255.248
#
return
[AR1000v1-GigabitEthernet0/0/1]quit
 
[AR1000v1]display ip routing-table | exclude 127
Route Flags: R - relay, D - download to fib, T - to vpn-instance
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 12       Routes : 12       
 
Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface
 
     10.10.10.0/29  Direct  0    0           D   10.10.10.1      GigabitEthernet0/0/0
    192.168.1.0/24  Direct  0    0           D   192.168.1.1     GigabitEthernet0/0/3
    192.168.2.0/24  Static  60   0          RD   10.10.10.2      GigabitEthernet0/0/0
    192.168.3.0/24  Static  80   0          RD   10.10.10.2      GigabitEthernet0/0/0

Testando a redundância

VPC6

VPCS> ping 192.168.1.10
 
84 bytes from 192.168.1.10 icmp_seq=1 ttl=61 time=14.205 ms
84 bytes from 192.168.1.10 icmp_seq=2 ttl=61 time=3.773 ms
84 bytes from 192.168.1.10 icmp_seq=3 ttl=61 time=3.037 ms
84 bytes from 192.168.1.10 icmp_seq=4 ttl=61 time=3.934 ms
84 bytes from 192.168.1.10 icmp_seq=5 ttl=61 time=3.377 ms
VPCS> trace 192.168.1.10
trace to 192.168.1.10, 8 hops max, press Ctrl+C to stop
 1   192.168.3.1   6.129 ms  17.458 ms  13.798 ms
 2   20.20.20.1   33.733 ms  53.060 ms  7.188 ms
 3   10.10.10.1   35.966 ms  7.811 ms  6.893 ms
 4   *192.168.1.10   2.737 ms (ICMP type:3, code:3, Destination port unreachable)
wikiv2/huawei_route_static.txt · Last modified: by 127.0.0.1