katorea memo

いろいろ

IP CLOS Underlay(BGP Unnumbered + RFC5549)

まさかの三年ぶりの更新。

最近よくIP CLOS的なものをよく聞くので試してみたいと思う。
まずは、Underlayの構築から。
最初Underlay、Overlayの意味すら知らなかったので理解するのにめっちゃ苦労した。

使用装置はArista vEOS 4.23.4MでSpine2台、Leaf4台構成。

UnderlayはIPv6構成。
・BGP Unnumberedを利用することで、IPv6 link local addressでBGP Peerが張れる。
・RFC5549を利用することで、NW上のInterfaceにIPv4アドレスが設定されていなくてもIPv4通信が可能となる。(IPv4 prefixのnexthopがIPv6アドレス宛になる)
みたい。

構成は以下。

f:id:gemunopedy:20200723233835p:plain

これまでの記事で使用していたのはeve-ngのアイコンだったけど、今回からInteropのアイコンでの構成図に変えてみた。やっぱかっこいい。
Leaf1/2がペア、leaf3/4がペア構成となっている。これはmlagとかの確認も後々したいのでこの構成。
Host1/2もServerではなく、vEOSで代用。
※eve-ng上でserver(Centos等)を準備するの個人的にめっちゃメンドイ

使用するinterface等などは、Spine、Leaf毎で極力統一している。

まずはSpine側のconfig。(関連しそうなとこだけ)

Spine1

interface Ethernet1
  no switchport
  ipv6 enable
  ipv6 address fe80::1/64 link-local
!
interface Ethernet2
  no switchport
  ipv6 address fe80::1/64 link-local
!
interface Ethernet3
  no switchport
  ipv6 enable
  ipv6 address fe80::1/64 link-local
!
interface Ethernet4
  no switchport
  ipv6 enable
  ipv6 address fe80::1/64 link-local
!
interface Loopback0
  ip address 1.1.1.1/32
!
ip routing ipv6 interfaces
!
ipv6 unicast-routing
!
peer-filter ALL
  10 match as-range 1-4294967295 result accept
!
router bgp 4200000001
  bgp default ipv4-unicast transport ipv6
  maximum-paths 128
  bgp listen range fe80::/10 peer-group Leaf peer-filter ALL
  neighbor Leaf peer group
  neighbor Leaf send-community extended
  redistribute connected
  !
  address-family ipv4
   neighbor Leaf activate
   neighbor Leaf next-hop address-family ipv6 originate
  !

・「interface Ethernet
Spine側のeth ipv6 addressは fe80::1/64で便宜上固定にしている。

・「ip routing ipv6 interface」
RFC5549を利用するために必要ぽい設定。

・「router bgp」
なんとなく4byteAS。
[bgp default ipv4-unicast transport ipv6]
 RFC5549のために必要ぽい設定。
[bgp listen range fe80::/10 peer-group Leaf peer-filter ALL]
 これでひとつずつneighborの設定をすることなく、この条件にマッチしたneighborとpeerが張れるようになれる。なんと便利。
[address-family ipv4 neighbor Leaf next-hop address-family ipv6 originate]
 これもRFC5549のために必要ぽい設定。

Leaf側はこんな感じ。

Leaf1

interface Ethernet1
  no switchport
  ipv6 enable
!
interface Ethernet2
  no switchport
  ipv6 enable
!
interface Loopback0
  ip address 3.3.3.3/32
!
ip routing 
!
ipv6 unicast-routing
!
router bgp 4200000101
  bgp default ipv4-unicast transport ipv6
  maximum-paths 128
  neighbor SPINE peer group
  neighbor SPINE remote-as 4200000001
  neighbor SPINE send-community extended
  neighbor fe80::1%Et1 peer group SPINE
  neighbor fe80::1%Et2 peer group SPINE
  redistribute connected
  !
  !
  address-family ipv4
   neighbor SPINE activate
   neighbor SPINE next-hop address-family ipv6 originate
  !

・「interface Ethernet
Leaf側link local addressを固定せずに利用。

・「router bgp」
neighbor指定はaddressとinterface指定。これでSpine側の同一link local address固定が可能。


redistribute connectedでlo addressを広報しているので、leaf1からleaf3へのlo address ping疎通が確認できればUnderlay構築完了。
まずは、leaf1のrouting table確認。

Leaf1#show ip route

 B E   1.1.1.1/32 [200/0]
      via fe80::1, Ethernet1
 B E   2.2.2.2/32 [200/0]
      via fe80::1, Ethernet2
 C    3.3.3.3/32 [0/0]
      via Loopback0, directly connected
 B E   5.5.5.5/32 [200/0]
      via fe80::1, Ethernet1
      via fe80::1, Ethernet2
 B E   6.6.6.6/32 [200/0]
      via fe80::1, Ethernet1
      via fe80::1, Ethernet2

leaf3(5.5.5.5)/leaf4(6.6.6.6)のnexthopがipv6となっている。spineのlo address(1.1.1.1/2.2.2.2)も同様。

ping/tracerouteの結果が以下。

Leaf1#ping 3.3.3.3
PING 3.3.3.3 (3.3.3.3) 72(100) bytes of data.
80 bytes from 3.3.3.3: icmp_seq=1 ttl=64 time=0.115 ms
80 bytes from 3.3.3.3: icmp_seq=2 ttl=64 time=0.023 ms

Leaf1#traceroute 5.5.5.5
traceroute to 5.5.5.5 (5.5.5.5), 30 hops max, 60 byte packets
 1 5.5.5.5 (5.5.5.5) 34.854 ms 40.264 ms 54.714 ms

よさげ。
これでUnderlay構築は完了。
IPv6構成の中、わざわざipv4経路を広報しているのは、VTEPの為という認識だけど、ここら辺ってうまくやれば一切のIPv4 addressを排除できるのだろうか?
ここらへんよく分かってないからもう少し調べる。


次はOverlay。EVPNの設定。