Table of Contents

Roteamento estático entre Huawei e Mikrotik

Cenário

Mikrotik-RO1

Alterando o hostname
[admin@MikroTik] > system identity set name=Mikrotik-RO1
Alterando o nome da interface
[admin@Mikrotik-RO1] > interface ethernet print 
Flags: X - disabled, R - running, S - slave 
 #    NAME                                MTU MAC-ADDRESS       ARP            
 0 R  ether1                             1500 50:00:00:01:00:00 enabled        
 1 R  ether2                             1500 50:00:00:01:00:01 enabled        
 2 R  ether3                             1500 50:00:00:01:00:02 enabled        
 3 R  ether4                             1500 50:00:00:01:00:03 enabled        
[admin@Mikrotik-RO1] > interface ethernet edit number=0 value-name=name
[admin@Mikrotik-RO1] > interface ethernet print 
Flags: X - disabled, R - running, S - slave 
 #    NAME                                MTU MAC-ADDRESS       ARP            
 0 R  ether1-PTP-NE40-RO1                1500 50:00:00:01:00:00 enabled        
 1 R  ether2                             1500 50:00:00:01:00:01 enabled        
 2 R  ether3                             1500 50:00:00:01:00:02 enabled        
 3 R  ether4                             1500 50:00:00:01:00:03 enabled  
Adicionando endereço IP
[admin@Mikrotik-RO1] > ip address add address=172.16.100.1/30 interface=ether1-PTP-NE40-RO1 
[admin@Mikrotik-RO1] > ip address comment numbers=0 comment=UPLINK-NE40-RO1
[admin@Mikrotik-RO1] > ip address print 
Flags: X - disabled, I - invalid, D - dynamic 
 #   ADDRESS            NETWORK         INTERFACE                              
 0   ;;; UPLINK-NE40-RO1
     172.16.100.1/30    172.16.100.0    ether1-PTP-NE40-RO1

NE40-RO1

Desabilitando os log do terminal/monitor
<HUAWEI>undo terminal monitor 
Alterando o hostname
<HUAWEI>system-view 
[~HUAWEI]sysname NE40-RO1
Adicionando endereço IP
[~NE40-RO1]interface Ethernet 1/0/1
[~NE40-RO1-Ethernet1/0/1]description UPLINK-Mikrotik-RO1
[*NE40-RO1-Ethernet1/0/1]ip address 172.16.100.2 255.255.255.252
[*NE40-RO1-Ethernet1/0/1]commit
[~NE40-RO1-Ethernet1/0/1]display this
#
interface Ethernet1/0/1
 description UPLINK-Mikrotik-RO1
 undo shutdown
 ip address 172.16.100.2 255.255.255.252
 dcn
 dcn mode vlan
#
return
[~NE40-RO1-Ethernet1/0/1]quit
[~NE40-RO1]
[~NE40-RO1]interface Ethernet 1/0/0
[~NE40-RO1-Ethernet1/0/0]description UPLINK-Mikrotik-RO2
[*NE40-RO1-Ethernet1/0/0]ip address 10.240.100.2 30
[*NE40-RO1-Ethernet1/0/0]commit 
[~NE40-RO1-Ethernet1/0/0]display this
#
interface Ethernet1/0/0
 description UPLINK-Mikrotik-RO2
 undo shutdown
 ip address 10.240.100.2 255.255.255.252
 dcn
 dcn mode vlan
#
return

Mikrotik-RO2

Alterando o hostname
[admin@MikroTik] > system identity set name=Mikrotik-RO2
Alterando o nome da interface
[admin@Mikrotik-RO2] > interface ethernet print 
Flags: X - disabled, R - running, S - slave 
 #    NAME                                MTU MAC-ADDRESS       ARP            
 0 R  ether1                             1500 50:00:00:02:00:00 enabled        
 1 R  ether2                             1500 50:00:00:02:00:01 enabled        
 2 R  ether3                             1500 50:00:00:02:00:02 enabled        
 3 R  ether4                             1500 50:00:00:02:00:03 enabled  
[admin@Mikrotik-RO2] > interface ethernet edit number=0 value-name=name
[admin@Mikrotik-RO2] > interface ethernet edit number=1 value-name=name
[admin@Mikrotik-RO2] > interface ethernet print 
Flags: X - disabled, R - running, S - slave 
 #    NAME                                MTU MAC-ADDRESS       ARP            
 0 R  ether1-PTP-NE40-RO1                1500 50:00:00:02:00:00 enabled        
 1 R  ether2-PTP-NE40-RO2                1500 50:00:00:02:00:01 enabled        
 2 R  ether3                             1500 50:00:00:02:00:02 enabled        
 3 R  ether4                             1500 50:00:00:02:00:03 enabled
Adicionando endereço IP
[admin@Mikrotik-RO2] > ip address add address=10.240.100.1/30 interface=ether1-PTP-NE40-RO1
[admin@Mikrotik-RO2] > ip address add address=10.240.110.1/30 interface=ether2-PTP-NE40-RO2
[admin@Mikrotik-RO2] > ip address comment numbers=0 comment=UPLINK-NE40-RO1
[admin@Mikrotik-RO2] > ip address comment numbers=1 comment=UPLINK-NE40-RO2
[admin@Mikrotik-RO2] > ip address print 
Flags: X - disabled, I - invalid, D - dynamic 
 #   ADDRESS            NETWORK         INTERFACE                              
 0   ;;; UPLINK-NE40-RO1
     10.240.100.1/30    10.240.100.0    ether1-PTP-NE40-RO1                    
 1   ;;; UPLINK-NE40-RO2
     10.240.110.1/30    10.240.110.0    ether2-PTP-NE40-RO2

NE40-RO2

Desabilitando os log do terminal/monitor
<HUAWEI>undo terminal monitor 
Alterando o hostname
<HUAWEI>system-view 
[~HUAWEI]sysname NE40-RO2
Adicionando endereço IP
[~NE40-RO2]interface Ethernet 1/0/0
[~NE40-RO2-Ethernet1/0/0]description UPLINK-Mikrotik-RO2
[*NE40-RO2-Ethernet1/0/0]ip address 10.240.110.2 30
[*NE40-RO2-Ethernet1/0/0]commit 
[~NE40-RO2-Ethernet1/0/0]display this
#
interface Ethernet1/0/0
 description UPLINK-Mikrotik-RO2
 undo shutdown
 ip address 10.240.110.2 255.255.255.252
 dcn
 dcn mode vlan
#
return
[~NE40-RO1-Ethernet1/0/1]quit
[~NE40-RO1]
[~NE40-RO2]interface Ethernet 1/0/1       
[~NE40-RO2-Ethernet1/0/1]description UPLINK-Mikrotik-RO3
[*NE40-RO2-Ethernet1/0/1]ip address 192.168.200.2 255.255.255.252
[*NE40-RO2-Ethernet1/0/1]commit 
[~NE40-RO2-Ethernet1/0/1]display this
#
interface Ethernet1/0/1
 description UPLINK-Mikrotik-RO3
 undo shutdown
 ip address 192.168.200.2 255.255.255.252
 dcn
 dcn mode vlan
#
return
[~NE40-RO2-Ethernet1/0/1]quit
[~NE40-RO2]

Mikrotik-RO3

Alterando o hostname
[admin@MikroTik] > system identity set name=Mikrotik-RO3
Alterando o nome da interface
[admin@Mikrotik-RO3] > interface ethernet print 
Flags: X - disabled, R - running, S - slave 
 #    NAME                                MTU MAC-ADDRESS       ARP            
 0 R  ether1                             1500 50:00:00:03:00:00 enabled        
 1 R  ether2                             1500 50:00:00:03:00:01 enabled        
 2 R  ether3                             1500 50:00:00:03:00:02 enabled        
 3 R  ether4                             1500 50:00:00:03:00:03 enabled      
[admin@Mikrotik-RO3] > interface ethernet edit number=0 value-name=name 
[admin@Mikrotik-RO3] > interface ethernet print 
Flags: X - disabled, R - running, S - slave 
 #    NAME                                MTU MAC-ADDRESS       ARP            
 0 R  ether1-PTP-NE40-RO2                1500 50:00:00:03:00:00 enabled        
 1 R  ether2                             1500 50:00:00:03:00:01 enabled        
 2 R  ether3                             1500 50:00:00:03:00:02 enabled        
 3 R  ether4                             1500 50:00:00:03:00:03 enabled  
Adicionando endereço IP
[admin@Mikrotik-RO3] > ip address add address=192.168.200.1/30 interface=ether1-PTP-NE40-RO2  
[admin@Mikrotik-RO3] > ip address comment numbers=0 comment=UPLINK-NE40-RO2
[admin@Mikrotik-RO3] > ip address print 
Flags: X - disabled, I - invalid, D - dynamic 
 #   ADDRESS            NETWORK         INTERFACE                              
 0   ;;; UPLINK-NE40-RO2
     192.168.200.1/30   192.168.200.0   ether1-PTP-NE40-RO2

Criando as rotas

Mikrotik-RO1

[admin@Mikrotik-RO1] > ip route add dst-address=10.240.100.0/30 gateway=172.16.100.2 comment=ROTA-REDE-10.240.100
[admin@Mikrotik-RO1] > ip route add dst-address=10.240.110.0/30 gateway=172.16.100.2 comment=ROTA-REDE-10.240.110
[admin@Mikrotik-RO1] > ip route add dst-address=192.168.200.0/30 gateway=172.16.100.2 comment=ROTA-REDE-192.168
[admin@Mikrotik-RO1] > ip route print 
Flags: X - disabled, A - active, D - dynamic, 
C - connect, S - static, r - rip, b - bgp, o - ospf, m - mme, 
B - blackhole, U - unreachable, P - prohibit 
 #      DST-ADDRESS        PREF-SRC        GATEWAY            DISTANCE
 0 A S  ;;; ROTA-REDE-10.240.100
        10.240.100.0/30                    172.16.100.2              1
 1 A S  ;;; ROTA-REDE-10.240.110
        10.240.110.0/30                    172.16.100.2              1
 2 ADC  172.16.100.0/30    172.16.100.1    ether1-PTP-NE40...        0
 3 A S  ;;; ROTA-REDE-192.168
        192.168.200.0/30                   172.16.100.2              1

Mikrotik-RO2

[admin@Mikrotik-RO2] > ip route add dst-address=172.16.100.0/30 gateway=10.240.100.2 comment=ROTA-REDE-172
[admin@Mikrotik-RO2] > ip route add dst-address=192.168.200.0/30 gateway=10.240.110.2 comment=ROTA-REDE-192
[admin@Mikrotik-RO2] > ip route print 
Flags: X - disabled, A - active, D - dynamic, 
C - connect, S - static, r - rip, b - bgp, o - ospf, m - mme, 
B - blackhole, U - unreachable, P - prohibit 
 #      DST-ADDRESS        PREF-SRC        GATEWAY            DISTANCE
 0 ADC  10.240.100.0/30    10.240.100.1    ether1-PTP-NE40...        0
 1 ADC  10.240.110.0/30    10.240.110.1    ether2-PTP-NE40...        0
 2 A S  ;;; ROTA-REDE-172
        172.16.100.0/30                    10.240.100.2              1
 3 A S  ;;; ROTA-REDE-192
        192.168.200.0/30                   10.240.110.2              1

Mikrotik-RO3

[admin@Mikrotik-RO3] > ip route add dst-address=10.240.110.0/30 gateway=192.168.200.2 comment=ROTA-REDE-10.240.110
[admin@Mikrotik-RO3] > ip route add dst-address=10.240.100.0/30 gateway=192.168.200.2 comment=ROTA-REDE-10.240.100
[admin@Mikrotik-RO3] > ip route add dst-address=172.10.100.0/30 gateway=192.168.200.2 comment=ROTA-REDE-172
[admin@Mikrotik-RO3] > ip route print 
Flags: X - disabled, A - active, D - dynamic, 
C - connect, S - static, r - rip, b - bgp, o - ospf, m - mme, 
B - blackhole, U - unreachable, P - prohibit 
 #      DST-ADDRESS        PREF-SRC        GATEWAY            DISTANCE
 0 A S  ;;; ROTA-REDE-10.240.100
        10.240.100.0/30                    192.168.200.2             1
 1 A S  ;;; ROTA-REDE-10.240.110
        10.240.110.0/30                    192.168.200.2             1
 2 A S  ;;; ROTA-REDE-172
        172.10.100.0/30                    192.168.200.2             1
 3 ADC  192.168.200.0/30   192.168.200.1   ether1-PTP-NE40...        0

NE40-RO1

[~NE40-RO1]ip route-static 10.240.110.0 30 10.240.100.1 description ROTA-REDE-10.240.110
[*NE40-RO1]ip route-static 192.168.200.0 255.255.255.252 10.240.100.1 description ROTA-REDE-192
[*NE40-RO1]commit 
[~NE40-RO1]display current-configuration configuration route-static 
#
ip route-static 10.240.110.0 255.255.255.252 10.240.100.1 description ROTA-REDE-10.240.110
ip route-static 192.168.200.0 255.255.255.252 10.240.100.1 description ROTA-REDE-192
#
return

NE40-RO1

[~NE40-RO2]ip route-static 10.240.100.0 30 10.240.110.1 description ROTA-REDE-10.240.100
[*NE40-RO2]ip route-static 172.16.100.0 255.255.255.252 10.240.110.1 description ROTA-REDE-172
[*NE40-RO2]commit 
[~NE40-RO2]display current-configuration configuration route-static 
#
ip route-static 10.240.100.0 255.255.255.252 10.240.110.1 description ROTA-REDE-10.240.100
ip route-static 172.16.100.0 255.255.255.252 10.240.110.1 description ROTA-REDE-172
#
return

Testando as rotas

[~NE40-RO1]ping 192.168.200.2
  PING 192.168.200.2: 56  data bytes, press CTRL_C to break
    Reply from 192.168.200.2: bytes=56 Sequence=1 ttl=254 time=12 ms
    Reply from 192.168.200.2: bytes=56 Sequence=2 ttl=254 time=6 ms
    Reply from 192.168.200.2: bytes=56 Sequence=3 ttl=254 time=4 ms
    Reply from 192.168.200.2: bytes=56 Sequence=4 ttl=254 time=5 ms
    Reply from 192.168.200.2: bytes=56 Sequence=5 ttl=254 time=2 ms
 
  --- 192.168.200.2 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 2/5/12 ms
[~NE40-RO1]ping 192.168.200.1
  PING 192.168.200.1: 56  data bytes, press CTRL_C to break
    Reply from 192.168.200.1: bytes=56 Sequence=1 ttl=62 time=11 ms
    Reply from 192.168.200.1: bytes=56 Sequence=2 ttl=62 time=3 ms
    Reply from 192.168.200.1: bytes=56 Sequence=3 ttl=62 time=2 ms
    Reply from 192.168.200.1: bytes=56 Sequence=4 ttl=62 time=2 ms
    Reply from 192.168.200.1: bytes=56 Sequence=5 ttl=62 time=7 ms
 
  --- 192.168.200.1 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 2/5/11 ms
 
[~NE40-RO1]