====== Roteamento estático entre diferentes fabricantes ====== ===== Cenário ===== ^Roteador^Rede^Interface^Endereço IP^ |vIOS-RO1|172.16.100.0/24|Gi0/0|172.16.100.254| |vIOS-RO1|172.16.200.0/24|Gi0/0|172.16.200.254| |vIOS-RO1|10.240.50.0/30|Gi0/1|10.240.50.1| |Mikrotik-RO1|10.240.50.0/30|eth1|10.240.50.2| |Mikrotik-RO1|10.240.100.0/30|eth2|10.240.100.1| |VyOS-RO1|10.240.100.0/30|eth0|10.240.100.2| |VyOS-RO1|10.240.150.0/30|eth1|10.240.150.1| |NE40-RO1|10.240.150.0/30|E1/0/0|10.240.150.2| |NE40-RO1|192.168.100.0/24|E1/0/1|192.168.100.254| |NE40-RO1|192.168.200.0/24|E1/0/1|192.168.200.254| ^Switch^Rede^Interface^VLAN^ |vIOS-SW1|172.16.100.0/24|Gi0/3|100| |vIOS-SW1|172.16.200.0/24|Gi1/3|200| |CE12800-SW1|192.168.100.0/24|GE1/0/3|100| |CE12800-SW1|192.168.200.0/24|GE1/0/6|200| ===== vIOS-RO1 ===== Router>enable Router#configure terminal outer(config)#hostname vIOS-RO1 vIOS-RO1(config)#end == Configuração de IP - Rede LAN == vIOS-RO1#show ip interface brief Interface IP-Address OK? Method Status Protocol GigabitEthernet0/0 unassigned YES unset administratively down down GigabitEthernet0/1 unassigned YES unset administratively down down GigabitEthernet0/2 unassigned YES unset administratively down down GigabitEthernet0/3 unassigned YES unset administratively down down vIOS-RO1#configure terminal vIOS-RO1(config)#interface gigabitEthernet 0/0.100 vIOS-RO1(config-subif)#encapsulation dot1Q 100 vIOS-RO1(config-subif)#ip address 172.16.100.254 255.255.255.0 vIOS-RO1(config-subif)#no shutdown vIOS-RO1(config-subif)#exit vIOS-RO1(config)#interface gigabitEthernet 0/0.200 vIOS-RO1(config-subif)#encapsulation dot1Q 200 vIOS-RO1(config-subif)#ip address 172.16.200.254 255.255.255.0 vIOS-RO1(config-subif)#no shutdown vIOS-RO1(config-subif)#exit vIOS-RO1(config)#interface GigabitEthernet0/0 vIOS-RO1(config-if)#no shutdown vIOS-RO1(config-if)#end vIOS-RO1#wr vIOS-RO1#show ip interface brief Interface IP-Address OK? Method Status Protocol GigabitEthernet0/0 unassigned YES unset up up GigabitEthernet0/0.100 172.16.100.254 YES manual up up GigabitEthernet0/0.200 172.16.200.254 YES manual up up GigabitEthernet0/1 unassigned YES unset administratively down down GigabitEthernet0/2 unassigned YES unset administratively down down GigabitEthernet0/3 unassigned YES unset administratively down down vIOS-RO1#show running-config interface GigabitEthernet0/0.100 Building configuration... Current configuration : 106 bytes ! interface GigabitEthernet0/0.100 encapsulation dot1Q 100 ip address 172.16.100.254 255.255.255.0 end vIOS-RO1#show running-config interface GigabitEthernet0/0.200 Building configuration... Current configuration : 106 bytes ! interface GigabitEthernet0/0.200 encapsulation dot1Q 200 ip address 172.16.200.254 255.255.255.0 end == Configuração de IP - Rede WAN == vIOS-RO1#configure terminal IOS-RO1(config)#interface gigabitEthernet 0/1 vIOS-RO1(config-if)#ip address 10.240.50.1 255.255.255.252 vIOS-RO1(config-if)#description UPLINK-Mikrotik-RO1 vIOS-RO1(config-if)#no shutdown vIOS-RO1(config-if)#exit vIOS-RO1(config)#end vIOS-RO1#wr vIOS-RO1#show ip interface brief Interface IP-Address OK? Method Status Protocol GigabitEthernet0/0 unassigned YES unset up up GigabitEthernet0/0.100 172.16.100.254 YES manual up up GigabitEthernet0/0.200 172.16.200.254 YES manual up up GigabitEthernet0/1 10.240.50.1 YES manual up up GigabitEthernet0/2 unassigned YES unset administratively down down GigabitEthernet0/3 unassigned YES unset administratively down down vIOS-RO1#show running-config interface GigabitEthernet0/1 Building configuration... Current configuration : 151 bytes ! interface GigabitEthernet0/1 description UPLINK-Mikrotik-RO1 ip address 10.240.50.1 255.255.255.252 duplex auto speed auto media-type rj45 end vIOS-RO1#show ip route Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2 i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 ia - IS-IS inter area, * - candidate default, U - per-user static route o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP a - application route + - replicated route, % - next hop override, p - overrides from PfR Gateway of last resort is not set 10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks C 10.240.50.0/30 is directly connected, GigabitEthernet0/1 L 10.240.50.1/32 is directly connected, GigabitEthernet0/1 172.16.0.0/16 is variably subnetted, 4 subnets, 2 masks C 172.16.100.0/24 is directly connected, GigabitEthernet0/0.100 L 172.16.100.254/32 is directly connected, GigabitEthernet0/0.100 C 172.16.200.0/24 is directly connected, GigabitEthernet0/0.200 L 172.16.200.254/32 is directly connected, GigabitEthernet0/0.200 ===== Mikrotik-RO1 ===== [admin@MikroTik] > system identity set name=Mikrotik-RO1 == Interface Uplink vIOS-RO1 == [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-vIOS-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 [admin@Mikrotik-RO1] > ip address add address=10.240.50.2/30 interface=ether1-PTP-vIOS-RO1 [admin@Mikrotik-RO1] > ip address comment numbers=0 comment=UPLINK-vIOS-RO1 == Interface Uplink VyOS-RO1 == [admin@Mikrotik-RO1] > interface ethernet edit number=1 value-name=name [admin@Mikrotik-RO1] > interface ethernet print Flags: X - disabled, R - running, S - slave int # NAME MTU MAC-ADDRESS ARP TP-vIOS-RO1 0 R ether1-PTP-vIOS-RO1 1500 50:00:00:01:00:00 enabled TP-vIOS-RO1 1 R ether2-PTP-VyOS-RO1 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] > ip address add address=10.240.100.1/30 interface=ether2-PTP-VyOS-RO1 [admin@Mikrotik-RO1] > ip address comment numbers=1 comment=UPLINK-VyOS-RO1 [admin@Mikrotik-RO1] > ip address print Flags: X - disabled, I - invalid, D - dynamic # ADDRESS NETWORK INTERFACE 0 ;;; UPLINK-vIOS-RO1 10.240.50.2/30 10.240.50.0 ether1-PTP-vIOS-RO1 1 ;;; UPLINK-VyOS-RO1 10.240.100.1/30 10.240.100.0 ether2-PTP-VyOS-RO1 [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 ADC 10.240.50.0/30 10.240.50.2 ether1-PTP-vIOS... 0 1 ADC 10.240.100.0/30 10.240.100.1 ether2-PTP-VyOS... 0 [admin@Mikrotik-RO1] > ping 10.240.50.1 SEQ HOST SIZE TTL TIME STATUS 0 10.240.50.1 56 255 5ms 1 10.240.50.1 56 255 4ms 2 10.240.50.1 56 255 5ms 3 10.240.50.1 56 255 4ms sent=4 received=4 packet-loss=0% min-rtt=4ms avg-rtt=4ms max-rtt=5ms ===== VyOS-RO1 ===== vyos@vyos:~$ show interfaces Codes: S - State, L - Link, u - Up, D - Down, A - Admin Down Interface IP Address S/L Description --------- ---------- --- ----------- eth0 - u/u eth1 - u/u eth2 - u/u eth3 - u/u lo 127.0.0.1/8 u/u ::1/128 vyos@vyos:~$ configure vyos@vyos# set system host-name VyOS-RO1 vyos@vyos# commit vyos@vyos# save vyos@vyos# show system host-name host-name VyOS-RO1 [edit] vyos@vyos# set interfaces ethernet eth0 address 10.240.100.2/30 vyos@vyos# set interfaces ethernet eth0 description UPLINK-Mikrotik-RO1 vyos@vyos# set interfaces ethernet eth1 address 10.240.150.1/30 vyos@vyos# set interfaces ethernet eth1 description UPLINK-NE40-RO1 vyos@vyos# commit vyos@vyos# save vyos@vyos# run show interfaces Codes: S - State, L - Link, u - Up, D - Down, A - Admin Down Interface IP Address S/L Description --------- ---------- --- ----------- eth0 10.240.100.2/30 u/u UPLINK-Mikrotik-RO1 eth1 10.240.150.1/30 u/u UPLINK-NE40-RO1 eth2 - u/u eth3 - u/u lo 127.0.0.1/8 u/u ::1/128 yos@vyos# run show ip route Codes: K - kernel route, C - connected, S - static, R - RIP, O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP, T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP, F - PBR, f - OpenFabric, > - selected route, * - FIB route, q - queued route, r - rejected route C>* 10.240.100.0/30 is directly connected, eth0, 00:01:47 C>* 10.240.150.0/30 is directly connected, eth1, 00:01:46 vyos@vyos# exit vyos@vyos:~$ show interfaces ethernet eth0 brief Codes: S - State, L - Link, u - Up, D - Down, A - Admin Down Interface IP Address S/L Description --------- ---------- --- ----------- eth0 10.240.100.2/30 u/u UPLINK-Mikrotik-RO1 vyos@vyos:~$ show interfaces ethernet eth1 brief Codes: S - State, L - Link, u - Up, D - Down, A - Admin Down Interface IP Address S/L Description --------- ---------- --- ----------- eth1 10.240.150.1/30 u/u UPLINK-NE40-RO1 ===== NE40-RO1 ===== undo terminal monitor system-view [~HUAWEI]sysname NE40-RO1 == Uplink VyOS-RO1 == [*HUAWEI]interface Ethernet 1/0/0 [*HUAWEI-Ethernet1/0/0]ip address 10.240.150.2 255.255.255.0 [*HUAWEI-Ethernet1/0/0]description UPLINK-VyOS-RO1 [*HUAWEI-Ethernet1/0/0]commit [~NE40-RO1]display current-configuration interface Ethernet 1/0/0 # interface Ethernet1/0/0 description UPLINK-VyOS-RO1 undo shutdown ip address 10.240.150.2 255.255.255.0 dcn dcn mode vlan # return == Uplink CE12800-SW1 == [~NE40-RO1]interface Ethernet 1/0/1.100 [*NE40-RO1-Ethernet1/0/1.100]vlan-type dot1q 100 [*NE40-RO1-Ethernet1/0/1.100]ip address 192.168.100.254 24 [*NE40-RO1-Ethernet1/0/1.100]commit [~NE40-RO1-Ethernet1/0/1.100]quit [~NE40-RO1]interface Ethernet 1/0/1.200 [*NE40-RO1-Ethernet1/0/1.200]vlan-type dot1q 200 [*NE40-RO1-Ethernet1/0/1.200]ip address 192.168.200.254 255.255.255.0 [*NE40-RO1-Ethernet1/0/1.200]commit [~NE40-RO1-Ethernet1/0/1.200]quit ===== vIOS-SW1 ===== Switch>enable Switch#configure terminal Switch(config)#hostname vIOS-SW1 vIOS-SW1(config)#no logging console == Configuração de VLAN == vIOS-SW1(config)#exit vIOS-SW1#show ip interface brief Interface IP-Address OK? Method Status Protocol GigabitEthernet0/0 unassigned YES unset up up GigabitEthernet0/1 unassigned YES unset up up GigabitEthernet0/2 unassigned YES unset up up GigabitEthernet0/3 unassigned YES unset up up GigabitEthernet1/0 unassigned YES unset up up GigabitEthernet1/1 unassigned YES unset up up GigabitEthernet1/2 unassigned YES unset up up GigabitEthernet1/3 unassigned YES unset up up vIOS-SW1(config)#interface gigabitEthernet 0/0 vIOS-SW1(config-if)#switchport trunk encapsulation dot1q vIOS-SW1(config-if)#switchport mode trunk vIOS-SW1(config-if)#no shutdown vIOS-SW1(config-if)#exit vIOS-SW1(config)#do show interfaces trunk Port Mode Encapsulation Status Native vlan Gi0/0 on 802.1q trunking 1 Port Vlans allowed on trunk Gi0/0 1-4094 Port Vlans allowed and active in management domain Gi0/0 1 Port Vlans in spanning tree forwarding state and not pruned Gi0/0 1 vIOS-SW1(config)#vlan 100 vIOS-SW1(config-vlan)#no shutdown vIOS-SW1(config-vlan)#exit vIOS-SW1(config)#vlan 200 vIOS-SW1(config-vlan)#no shutdown vIOS-SW1(config-vlan)#exit vIOS-SW1(config)#interface vlan 100 vIOS-SW1(config-if)#ip address 172.16.100.253 255.255.255.0 vIOS-SW1(config-if)#no shutdown vIOS-SW1(config-if)#exit vIOS-SW1(config)#interface vlan 200 vIOS-SW1(config-if)#ip address 172.16.200.253 255.255.255.0 vIOS-SW1(config-if)#no shutdown vIOS-SW1(config-if)#exit vIOS-SW1(config)#exit vIOS-SW1#show vlan VLAN Name Status Ports ---- -------------------------------- --------- ------------------------------- 1 default active Gi0/1, Gi0/2, Gi0/3, Gi1/0 Gi1/1, Gi1/2, Gi1/3 100 VLAN0100 active 200 VLAN0200 active 1002 fddi-default act/unsup 1003 token-ring-default act/unsup 1004 fddinet-default act/unsup 1005 trnet-default act/unsup VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2 ---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------ 1 enet 100001 1500 - - - - - 0 0 100 enet 100100 1500 - - - - - 0 0 200 enet 100200 1500 - - - - - 0 0 1002 fddi 101002 1500 - - - - - 0 0 1003 tr 101003 1500 - - - - - 0 0 1004 fdnet 101004 1500 - - - ieee - 0 0 1005 trnet 101005 1500 - - - ibm - 0 0 Remote SPAN VLANs ------------------------------------------------------------------------------ Primary Secondary Type Ports ------- --------- ----------------- ------------------------------------------ vIOS-SW1#configure terminal vIOS-SW1(config)#interface gigabitEthernet 0/3 vIOS-SW1(config-if)#switchport mode access vIOS-SW1(config-if)#switchport access vlan 100 vIOS-SW1(config-if)#no shutdown vIOS-SW1(config-if)#exit vIOS-SW1(config)#interface gigabitEthernet 1/3 vIOS-SW1(config-if)#switchport mode access vIOS-SW1(config-if)#switchport access vlan 200 vIOS-SW1(config-if)#no shutdown vIOS-SW1(config-if)#end vIOS-SW1#wr vIOS-SW1#show vlan VLAN Name Status Ports ---- -------------------------------- --------- ------------------------------- 1 default active Gi0/1, Gi0/2, Gi1/0, Gi1/1 Gi1/2 100 VLAN0100 active Gi0/3 200 VLAN0200 active Gi1/3 1002 fddi-default act/unsup 1003 token-ring-default act/unsup 1004 fddinet-default act/unsup 1005 trnet-default act/unsup VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2 ---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------ 1 enet 100001 1500 - - - - - 0 0 100 enet 100100 1500 - - - - - 0 0 200 enet 100200 1500 - - - - - 0 0 1002 fddi 101002 1500 - - - - - 0 0 1003 tr 101003 1500 - - - - - 0 0 1004 fdnet 101004 1500 - - - ieee - 0 0 1005 trnet 101005 1500 - - - ibm - 0 0 Remote SPAN VLANs ------------------------------------------------------------------------------ Primary Secondary Type Ports ------- --------- ----------------- ------------------------------------------ vIOS-SW1#show running-config interface gigabitEthernet 0/3 Building configuration... Current configuration : 106 bytes ! interface GigabitEthernet0/3 switchport access vlan 100 switchport mode access negotiation auto end vIOS-SW1#show running-config interface gigabitEthernet 1/3 Building configuration... Current configuration : 106 bytes ! interface GigabitEthernet1/3 switchport access vlan 200 switchport mode access negotiation auto end ===== VPC10 ===== VPCS> ip 172.16.100.10 255.255.255.0 172.16.100.254 Checking for duplicate address... VPCS : 172.16.100.10 255.255.255.0 gateway 172.16.100.254 VPCS> show ip NAME : VPCS[1] IP/MASK : 172.16.100.10/24 GATEWAY : 172.16.100.254 DNS : MAC : 00:50:79:66:68:07 LPORT : 20000 RHOST:PORT : 127.0.0.1:30000 MTU : 1500 VPCS> ping 172.16.100.254 84 bytes from 172.16.100.254 icmp_seq=1 ttl=255 time=10.575 ms 84 bytes from 172.16.100.254 icmp_seq=2 ttl=255 time=10.636 ms 84 bytes from 172.16.100.254 icmp_seq=3 ttl=255 time=13.593 ms 84 bytes from 172.16.100.254 icmp_seq=4 ttl=255 time=16.271 ms 84 bytes from 172.16.100.254 icmp_seq=5 ttl=255 time=11.474 ms VPCS> ping 172.16.200.20 84 bytes from 172.16.200.20 icmp_seq=1 ttl=63 time=15.930 ms 84 bytes from 172.16.200.20 icmp_seq=2 ttl=63 time=19.460 ms 84 bytes from 172.16.200.20 icmp_seq=3 ttl=63 time=19.107 ms 84 bytes from 172.16.200.20 icmp_seq=4 ttl=63 time=19.712 ms 84 bytes from 172.16.200.20 icmp_seq=5 ttl=63 time=16.999 ms ===== VPC20 ===== VPCS> ip 172.16.200.20 255.255.255.0 172.16.200.254 Checking for duplicate address... VPCS : 172.16.200.20 255.255.255.0 gateway 172.16.200.254 VPCS> show ip NAME : VPCS[1] IP/MASK : 172.16.200.20/24 GATEWAY : 172.16.200.254 DNS : MAC : 00:50:79:66:68:08 LPORT : 20000 RHOST:PORT : 127.0.0.1:30000 MTU : 1500 VPCS> ping 172.16.200.254 84 bytes from 172.16.200.254 icmp_seq=1 ttl=255 time=10.366 ms 84 bytes from 172.16.200.254 icmp_seq=2 ttl=255 time=10.357 ms 84 bytes from 172.16.200.254 icmp_seq=3 ttl=255 time=13.699 ms 84 bytes from 172.16.200.254 icmp_seq=4 ttl=255 time=9.029 ms 84 bytes from 172.16.200.254 icmp_seq=5 ttl=255 time=12.146 ms VPCS> ping 172.16.100.10 84 bytes from 172.16.100.10 icmp_seq=1 ttl=63 time=17.171 ms 84 bytes from 172.16.100.10 icmp_seq=2 ttl=63 time=15.926 ms 84 bytes from 172.16.100.10 icmp_seq=3 ttl=63 time=16.871 ms 84 bytes from 172.16.100.10 icmp_seq=4 ttl=63 time=11.504 ms 84 bytes from 172.16.100.10 icmp_seq=5 ttl=63 time=15.965 ms ===== CE12800-SW1 ===== [~HUAWEI]interface GE 1/0/1 undo portswitch undo shutdown ip address ...