Настройка BGP, NAT и OSPF на RTR-BR

  • В настоящий момент:
    • te0 — порт в сторону ISP
    • te1 — порт в сторону FW-BR
ecorouter>show port brief
 Name             Physical   Admin   Lacp    Last Change        Description
 --------------------------------------------------------------------------
 te0              UP         UP      *       19m:46s ago        
 te1              UP         UP      *       19m:46s ago        
ecorouter>
  • Базовая настройка:
    • имя
    • адресация в соответствие с L3
    • требуемый пользователь
enable
conf
hostname rtr-br
ip domain-name au.team

username net_admin
password P@ssw0rd
role admin
exit
interface int0
description "to-ISP"
ip address 84.212.78.78/27
exit
port te0
service-instance te0/int0
encapsulation untagged 
connect ip interface int0 
exit
exit
interface int1
description "to-FW-BR"
ip address 10.2.0.1/30
exit
port te1
service-instance te1/int1
encapsulation untagged 
connect ip interface int1
exit
exit
exit
write memory
  • Проверить:
rtr-br#show hostname
rtr-br
rtr-br#show run | include ip domain-name
ip domain-name au.team
rtr-br#show users localdb 
User: admin
 Description: Administrator User
 Docker socket access: disabled
 VR:
  pvr
 Roles:
  admin
User: daemon
 Description: The user is used to get configuration data
 Docker socket access: disabled
 VR:
  pvr
 Roles:
  daemon
User: net_admin
 Description: 
 Docker socket access: disabled
 VR:
  pvr
 Roles:
  admin
rtr-br#show ip int br
 Interface        IP-Address          Status                 VRF
 ----------------------------------------------------------------
 int0             84.212.78.78/27     up                     default
 int1             10.2.0.1/30         up                     default
rtr-br#ping 84.212.78.94
PING 84.212.78.94 (84.212.78.94) 56(84) bytes of data.
64 bytes from 84.212.78.94: icmp_seq=1 ttl=64 time=16.8 ms
64 bytes from 84.212.78.94: icmp_seq=2 ttl=64 time=15.9 ms
64 bytes from 84.212.78.94: icmp_seq=3 ttl=64 time=14.4 ms

--- 84.212.78.94 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2002ms
rtt min/avg/max/mdev = 14.426/15.696/16.774/0.968 ms
rtr-br#
  • Создаём интерфейс loopback.0 и назначаем на него IP-адрес:
conf
interface loopback.0
ip address 192.168.255.2/32
no shutdown 
exit
  • Проверить:
rtr-br(config)#do show ip interface brief loopback.0 
 Interface        IP-Address          Status                 VRF
 ----------------------------------------------------------------
 loopback.0       192.168.255.2/32    up                     default
rtr-br(config)#
  • Настраиваем IS-IS:
router isis
net 49.0001.1921.6825.5002.00
is-type level-2-only
metric-style wide
passive-interface loopback.0 
exit
interface int0 
ip router isis
isis circuit-type level-2-only
isis network point-to-point
exit
interface loopback.0
ip router isis
exit
  • Проверить:
rtr-br(config)#do show ip route isis
IP Route Table for VRF "default"
i L2    192.168.255.1/32 [115/20] via 84.212.78.94, int0, 00:00:08

Gateway of last resort is not set
rtr-br(config)#do ping 192.168.255.1
PING 192.168.255.1 (192.168.255.1) 56(84) bytes of data.
64 bytes from 192.168.255.1: icmp_seq=1 ttl=64 time=15.3 ms
64 bytes from 192.168.255.1: icmp_seq=2 ttl=64 time=14.3 ms
64 bytes from 192.168.255.1: icmp_seq=3 ttl=64 time=13.4 ms

--- 192.168.255.1 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2002ms
rtt min/avg/max/mdev = 13.410/14.324/15.286/0.766 ms
rtr-br(config)#
  • Настраиваем BGP:
router bgp 64499
bgp router-id 192.168.255.2
bgp log-neighbor-changes
neighbor 192.168.255.1 remote-as 64499
neighbor 192.168.255.1 update-source loopback.0
neighbor 192.168.255.1 description iBGP-to-ISP
address-family ipv4 unicast
neighbor 192.168.255.1 activate
neighbor 192.168.255.1 next-hop-self
exit-address-family
exit
exit
write memory
  • Проверить:
rtr-br#show ip bgp summary
BGP router identifier 192.168.255.2, local AS number 64499
BGP table version is 2
1 BGP AS-PATH entries
0 BGP community entries

Neighbor        V    AS     MsgRcv    MsgSen    TblVer  InQ   OutQ   Up/Down   State/PfxRcd
-------------------------------------------------------------------------------------------
192.168.255.1   4    64499  5         2         2       0     0      00:00:10     2

Total number of neighbors 1

Total number of Established sessions 1
rtr-br#
rtr-br#show ip route
Codes: C - connected, S - static, R - RIP, B - BGP
       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, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
       * - candidate default

IP Route Table for VRF "default"
Gateway of last resort is 192.168.255.1 to network 0.0.0.0

B*      0.0.0.0/0 [200/0] via 192.168.255.1 (recursive  via 84.212.78.94), 00:00:26
C       10.2.0.0/30 is directly connected, int1
C       84.212.78.64/27 is directly connected, int0
B       100.64.0.0/16 [200/0] via 192.168.255.1 (recursive  via 84.212.78.94), 00:00:26
i L2    192.168.255.1/32 [115/20] via 84.212.78.94, int0, 00:01:24
C       192.168.255.2/32 is directly connected, loopback.0
rtr-br#ping 77.88.8.8
PING 77.88.8.8 (77.88.8.8) 56(84) bytes of data.
64 bytes from 77.88.8.8: icmp_seq=1 ttl=55 time=90.7 ms
64 bytes from 77.88.8.8: icmp_seq=2 ttl=55 time=89.6 ms
64 bytes from 77.88.8.8: icmp_seq=3 ttl=55 time=88.6 ms

--- 77.88.8.8 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2002ms
rtt min/avg/max/mdev = 88.593/89.614/90.694/0.858 ms
rtr-br#
  • Настраиваем NAT:
conf

interface int0
ip nat outside 
exit
interface int1
ip nat inside 
exit
ip nat pool BR 10.2.0.1-10.2.2.126
ip nat source dynamic inside-to-outside pool BR overload interface int0
write memory
  • Настраиваем OSPF в сторону FW-BR для анонсирования маршрута по умолчанию:
router ospf 1
passive-interface default
no passive-interface int1 
network 10.2.0.0/30 area 1
default-information originate
exit
write memory