gorosuke5656の日記

ネットワーク好きで個人で色々勉強しています😀 ですので内容はメーカーの公式見解ではありません🙇‍♀️

JuniperでOSPFを使用してデフォルトルートを広告する

みなさんお疲れさまです!
現在作成しているBGP演習ですが

AS65000~AS65001間の経路が冗長化されていないので、
ボチボチconfigを修正しております🐶

 


今回はAS65001→AS65000の間の経路を冗長化したいと思います(^^;)

 

AS65000~AS65001はEBGP接続で経路はStaticルートで実施しています。
今回はAS65001のPOD5/6間で動作しているIGP(OSPF)にデフォルトルート

を広告させ各PODからCOREに対する回線が切断された場合でも

隣のPOD経由で通信できるようにします。

 

今回はPOD5(VR1)においてデフォルトルートをOSPFで広告し、確認したいと思います~

 

お品書き(;^_^A

★デフォルトルート広告の設定を実施します
★OSPFネイバーをクリアします。
★経路情報を確認します
★通信確認します
★AS65001(POD5)とAS65000(CORE)間のインタフェースをダウンします
★Tracerouteで確認 → POD6(VR2)経由で2.2.2.2と通信していることを確認します
★インタフェースを復旧します

では始めます~

 

構成図になります!

★デフォルトルート広告の設定を実施します

OSPFのLSAタイプ5について

 

いつものサイト
https://www.infraexpert.com/study/ospfz16.html

 

LSAタイプ5( 外部LSA )は、AS全体にフラッディングされます。

LSAタイプ5は、ASBRが生成します。
LSAには非OSPFネットワークアドレス、サブネットマスク、メトリック値、

転送アドレスが含まれます。
このLSAは非OSPFネットワークのルート情報を再配布したASBRが生成します。

 

ルーティングテーブルでLSAタイプ5の経路情報は、

Juniperにおいては優先度が150として広告されます
(OSPF内部経路の場合は優先度:100)

 

デフォルトルート広告の設定

 

ざっくり説明すると

VR2が上位(CORE)に設定しているデフォルトルートに対してメトリック値100を付与し、かつOSPFのLS Type5 AS-external-LSAsのtype1として設定
それをOSPF設定のエクスポートポリシーに設定します

 

またLSAタイプ5については以下の2つが存在します
 この両者では、OSPF外部ネットワークまでのコスト値の計算が異なります。

 external Type1
   コスト値は、外部コストにASBRまでのコストを足した値になります
 external Type2
   コスト値は、外部コストのみの値になります

  また、同一のOSPF外部ネットワークに対して
  Type1とType2の2つが存在した場合は、常にType1が優先されます。

 

★OSPFネイバーをクリアします。
[edit]
admin@SRX100H2# run clear ospf neighbor instance VR1

[edit]
admin@SRX100H2#

[edit]
admin@SRX100H2# run clear ospf neighbor instance VR2

[edit]
admin@SRX100H2#

念のためPOD5/6も。。

 

★経路情報を確認します

 

★通信確認します

★通信確認します。
 AS65000(CORE)のループバックアドレスに向けてpingを実施します!

admin@SRX100H2> ping 2.2.2.2 routing-instance VR1
PING 2.2.2.2 (2.2.2.2): 56 data bytes
64 bytes from 2.2.2.2: icmp_seq=0 ttl=64 time=4.858 ms
64 bytes from 2.2.2.2: icmp_seq=1 ttl=64 time=2.855 ms
^C
--- 2.2.2.2 ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max/stddev = 2.855/3.856/4.858/1.002 ms

admin@SRX100H2> ping 2.2.2.2 routing-instance VR1 source 10.1.6.254
PING 2.2.2.2 (2.2.2.2): 56 data bytes
64 bytes from 2.2.2.2: icmp_seq=0 ttl=64 time=7.486 ms
64 bytes from 2.2.2.2: icmp_seq=1 ttl=64 time=3.301 ms
64 bytes from 2.2.2.2: icmp_seq=2 ttl=64 time=3.024 ms
^C
--- 2.2.2.2 ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max/stddev = 3.024/4.604/7.486/2.041 ms


admin@SRX100H2> traceroute 2.2.2.2 routing-instance VR1 source 10.1.6.254
traceroute to 2.2.2.2 (2.2.2.2) from 10.1.6.254, 30 hops max, 40 byte packets
 1  2.2.2.2 (2.2.2.2)  4.588 ms  9.512 ms  9.412 ms

admin@SRX100H2>

 

★AS65001(POD5)とAS65000(CORE)間のインタフェースをダウンします
admin@SRX100H2> configure
Entering configuration mode

[edit]
admin@SRX100H2# set interfaces fe-0/0/4 disable

[edit]
admin@SRX100H2# commit check
configuration check succeeds

[edit]
admin@SRX100H2# commit
commit complete

 

★Tracerouteで確認 → POD6(VR2)経由で2.2.2.2と通信していることを確認します

 

 

[edit]
admin@SRX100H2# run traceroute 2.2.2.2 routing-instance VR1 source 10.1.6.254
traceroute to 2.2.2.2 (2.2.2.2) from 10.1.6.254, 30 hops max, 40 byte packets
 1  172.30.3.5 (172.30.3.5)  6.079 ms  3.967 ms  3.891 ms
 2  2.2.2.2 (2.2.2.2)  4.338 ms  4.708 ms  10.407 ms

 

経路が切り替わっていることを確認できますね~

 

★インタフェースを復旧します
[edit]
admin@SRX100H2# delete interfaces fe-0/0/4 disable

[edit]
admin@SRX100H2# commit
commit complete

[edit]
admin@SRX100H2# run traceroute 2.2.2.2 routing-instance VR1 source 10.1.6.254
traceroute to 2.2.2.2 (2.2.2.2) from 10.1.6.254, 30 hops max, 40 byte packets
 1  2.2.2.2 (2.2.2.2)  12.070 ms  4.277 ms  10.299 ms

[edit]
admin@SRX100H2#

 


POD6(VR1)においても以下の設定を追加します(メトリック値200)
set policy-options policy-statement DEFAULT-ORIGNATE-POD6 term 1 from protocol static
set policy-options policy-statement DEFAULT-ORIGNATE-POD6 term 1 from route-filter 0.0.0.0/0 exact
set policy-options policy-statement DEFAULT-ORIGNATE-POD6 term 1 then metric 200
set policy-options policy-statement DEFAULT-ORIGNATE-POD6 term 1 then external type 1
set policy-options policy-statement DEFAULT-ORIGNATE-POD6 term 1 then accept
set policy-options policy-statement DEFAULT-ORIGNATE-POD6 term 999 then reject
set routing-instances VR1 protocols ospf export DEFAULT-ORIGNATE-POD6


次回はBFDを使用してStaticルートでの経路切替設定および確認を実施します~(^^;)

 

 

 

ExtremeXOSをL2スイッチとして設定する

みなさんお疲れさまです~(^^;)

今回は

ExtremeXOSでL2スイッチとして設定、確認したいと思います!

前回の記事はこちらです~

Extreme XOSをVirtualBox上にインストールしてみました!!
https://gorosuke5656.hatenablog.com/entry/2023/10/15/092832

今回はVirtualBOX上で以下のような構成で確認してみました!

 

構成図

 

 

1台のEXOSをL2スイッチとして設定し、配下にVyosを2台ぶら下げます

(Vyosはホスト的に使用)

今回のゴールはEXOSをL2スイッチとして設定し、

同一セグメントにいるVyosが通信できるかを確認します!

 

お品書き
 ① ホスト名の設定
  ② VLANの設定
 ③ 通信確認

 

① ホスト名の設定
EXOS-VM.2 # configure snmp sysName EXOS-1
* EXOS-1.3 # save
The configuration file primary.cfg already exists.
Do you want to save configuration to primary.cfg and overwrite it? (y/N) Yes
Saving configuration primary.cfg  on master ....... done!
Configuration saved to primary.cfg successfully.
EXOS-1.4 #

 ② VLANの設定

EXOS-1.2 # configure vlan Default delete port all
• ポートに新しいVLANを追加する前に、ポートから既存のVLANメンバーシップを削除しておきましょう!
(すべてのポートは最初に「デフォルト」VLANから削除しておくとよい)


〇 VLANの定義を実施します
* EXOS-1.4 # configure vlan VLAN100 tag 100


〇アンタグVLANの設定を実施します
* EXOS-1.5 # configure vlan VLAN100 add port 3 untagged
* EXOS-1.6 # configure vlan VLAN100 add port 1 untagged
* EXOS-1.7 # save
The configuration file primary.cfg already exists.
Do you want to save configuration to primary.cfg and overwrite it? (y/N) Yes
Saving configuration primary.cfg  on master ....... done!
Configuration saved to primary.cfg successfully.
EXOS-1.8 #


〇(注意!)EXOSにおけるVirtualBOXの設定について
  EXOSをL2スイッチ的に使用する場合は以下のように
  インタフェースをプロミスキャスモードに設定しておきましょう!!
  (でないと自分自身宛の通信以外を廃棄してしまいます。。。)

 

③ 通信確認
 EXOSに接続されたVyos間で通信ができるかを確認します!

念のためMACアドレステーブルをクリア(FDBをクリア)しておきますね

EXOS-1.8 # clear fdb
EXOS-1.9 #

VYOS間で通信ができることを確認後、EXOSでMACアドレステーブル(FDB)が確認しましょう!

EXOS-1.9 # show fdb
MAC                                      VLAN Name( Tag)  Age  Flags          Port / Virtual Port List
------------------------------------------------------------------------------------------------------

Flags : d - Dynamic, s - Static, p - Permanent, n - NetLogin, m - MAC, i - IP,
        x - IPX, l - lockdown MAC, L - lockdown-timeout MAC, M- Mirror, B - Egress Blackhole,
        b - Ingress Blackhole, v - MAC-Based VLAN, P - Private VLAN, T - VLAN translation,
        D - drop packet, h - Hardware Aging, o - IEEE 802.1ah Backbone MAC,
        S - Software Controlled Deletion, r - MSRP,
        X - VXLAN, E - EVPN

Total: 0 Static: 0  Perm: 0  Dyn: 0  Dropped: 0  Locked: 0  Locked with Timeout: 0
FDB Aging time: 300
EXOS-1.10 #
EXOS-1.10 # show fdb
MAC                                      VLAN Name( Tag)  Age  Flags          Port / Virtual Port List
------------------------------------------------------------------------------------------------------
08:00:27:aa:f3:27                          VLAN100(0100) 0005  d m            1
08:00:27:e5:f9:26                          VLAN100(0100) 0005  d m            3

Flags : d - Dynamic, s - Static, p - Permanent, n - NetLogin, m - MAC, i - IP,
        x - IPX, l - lockdown MAC, L - lockdown-timeout MAC, M- Mirror, B - Egress Blackhole,
        b - Ingress Blackhole, v - MAC-Based VLAN, P - Private VLAN, T - VLAN translation,
        D - drop packet, h - Hardware Aging, o - IEEE 802.1ah Backbone MAC,
        S - Software Controlled Deletion, r - MSRP,
        X - VXLAN, E - EVPN

Total: 2 Static: 0  Perm: 0  Dyn: 2  Dropped: 0  Locked: 0  Locked with Timeout: 0
FDB Aging time: 300
EXOS-1.10 #

 


〇VYOSのインタフェースに割り当てられているMACアドレスを学習していますね~

〇今回のVLAN設定について

 

EXOS-1.1 # show vlan
Untagged ports auto-move: Inform
-----------------------------------------------------------------------------------------------
Name            VID  Protocol Addr       Flags                         Proto  Ports  Virtual
                                                                              Active router
                                                                              /Total
-----------------------------------------------------------------------------------------------
Default         1    ----------------------------------------------    ANY    0 /0   VR-Default
Mgmt      4095 192.168.56.103 /24  --------------------------    ANY    1 /1   VR-Mgmt
VLAN100    100  ----------------------------------------------    ANY    2 /2   VR-Default
-----------------------------------------------------------------------------------------------
Flags : (B) BFD Enabled, (c) 802.1ad customer VLAN, (C) EAPS Control VLAN,
        (d) Dynamically created VLAN, (D) VLAN Admin Disabled,
        (E) ESRP Enabled, (f) IP Forwarding Enabled,
        (F) Learning Disabled, (i) ISIS Enabled,
        (I) Inter-Switch Connection VLAN for MLAG, (k) PTP Configured,
        (l) MPLS Enabled, (L) Loopback Enabled, (m) IPmc Forwarding Enabled,
        (M) Translation Member VLAN or Subscriber VLAN, (n) IP Multinetting Enabled,
        (N) Network Login VLAN, (o) OSPF Enabled, (O) Virtual Network Overlay,
        (p) PIM Enabled, (P) EAPS protected VLAN, (r) RIP Enabled,
        (R) Sub-VLAN IP Range Configured, (s) Sub-VLAN, (S) Super-VLAN,
        (t) Translation VLAN or Network VLAN, (T) Member of STP Domain,
        (v) VRRP Enabled, (V) VPLS Enabled, (W) VPWS Enabled,
        (Y) Policy Enabled

Total number of VLAN(s) : 3
EXOS-1.2 #

 


〇今回のconfigです~(抜粋)

EXOS-1.4 # show configuration
#
# Module devmgr configuration.
#
configure snmp sysName "EXOS-1"
configure snmp sysContact "https://www.extremenetworks.com/support/"
configure sys-recovery-level switch reset

#
# Module vlan configuration.
#
configure vlan default delete ports all
configure vr VR-Default delete ports 1-3
configure vr VR-Default add ports 1-3
configure vlan default delete ports 1-3
create vlan "VLAN100"
configure vlan VLAN100 tag 100
configure vlan VLAN100 add ports 1,3 untagged

 

参考資料のリンクをご紹介します!
ExtremeSwitch EXOS のスタートキット
https://hantechnote.wordpress.com/2020/07/10/extremeswitch-exos-%E3%81%AE%E3%82%B9%E3%82%BF%E3%83%BC%E3%83%88%E3%82%AD%E3%83%83%E3%83%88/

EXOS31.1のオンラインマニュアル
https://documentation.extremenetworks.com/exos_31.1/GUID-7D648968-51CD-4E05-828C-8606BD5C0474.shtml

 

次回はEXOSを1台追加してタグVLAN及びLAGの設定および確認をしたいと思います(^^;)

 

 

 

Extreme XOSをVirtualBox上にインストールしてみました!!

みなさんお疲れさまです~(^^;)

extremenetworksのネットワークOS(EXOS)の仮想版が入手できることを

最近知りまして、早速VirtualBOX上にインストールしました~

今回はインストールからホストからのSSH接続までの要領を紹介したいと思います!

 

お品書きです。

① EXOSとは?
② VEXOSの入手方法
③ VEXOSをVirtualBOX上に展開
④ ホストPCからVEXOSにSSHでアクセス

以上になります

 

では早速始めますね!!

 

① EXOSとは?
ExtremeSwitching (EXOS)シリーズは、コンパクトな1RUボックス型のイーサネット

スイッチ製品です。
ExtremeSwitching (EXOS)シリーズには、単一のオペレーションシステムで

ある「ExtremeXOS」を採用しているため、
オペレーションの共通化が図れ、運用管理の簡素化に貢献します。
「ExtremeXOS」は、モジュラー型オペレーションシステムであり、

ノンストップオペレーションを可能にする様々な機能を搭載しております。 

 

参考サイト
https://cn.teldevice.co.jp/product/extreme-extremeswitching-exos/

 

日本語公式サイト
https://www.extremenetworks.com/ Extreme Networks
https://jp.extremenetworks.com/ Extreme Networks (日本語ページ)
https://jp.extremenetworks.com/products/ 製品紹介ページ

 

 

② VEXOSの入手方法
  Github上にEXOSの仮想版であるVEXOSが公開されており、

 現時点で自由にダウンロードして使用することができます!
      →  ここら辺が庶民にとってはうれしいですね~(^^;)

 

 〇EXOSのダウンロードサイト
  https://github.com/extremenetworks/Virtual_EXOS

 なんとインストールガイドもあります~
  今回は
   vm-31.1.1.3-patch1-1.x86_64.iso
   (Extreme XOS 31.1.1.3)をダウンロードしました!

 

③ VEXOSをVirtualBOX上に展開
  では早速virtualBOXにVEXOSを展開していきます~

参考サイトです!

(ぶっちゃけこのサイトの通りに設定しました(笑):ありがとうございます!)

〇15年ぶりのExtreme XOSをVirtualBoxで動かす
 https://debslink.hatenadiary.jp/entry/20210918/1631968315

 

今回私の環境は図の通りです

今回の環境~

ここでは上記のサイトの手順にしたがって、図で補足しながら説明していきます!!

 


ア downloadしたisoファイルをvirtualBOX上で設定
  仮想マシン → 仮想マシンの作成
   Operating System
   Type:Linux
   Version:Other Linux (64-bit)

 

イ メモリサイズの指定
   当初 512Mにしましたが256Mでも動きます

 (Github上のインストールガイドでは256で実施)
    → いまどきこのメモリサイズで動いてくれるのがステキ~!!!

ウ 起動ディスクを選択
    先ほどDLしたisoファイルを選択

エ 仮想マシンを起動→ VEXOSのインストール作業に入ります
   C)を選択してインストール作業に入ります

 

この後、対話形式の設定に入りますが、

全てNで返答し設定を終わらせるか、
qキーを叩き対話形式の設定から抜けましょう~

 


オ 仮想マシンを停止後、以下の作業

〇 CD/DVDメディアを読み込ませないようVirtualBox側の設定を修正。
 VirtualBox Manager 
  設定 -> システム -> マザーボード

      →起動順序で光学のチェックを外してハードディスクにする
  設定 -> ストレージ 

   .isoファイルを選択し、欄下側のバツアイコンをクリックし.isoファイルを外す。

 

カ VirtualBOXにおけるEXOSのネットワークにおいて
  アダプター1(マネージメントネットワーク)をホストオンリーアタプタに設定

キ 仮想マシンを起動 → ユーザ:admin パス:なし
  show versionコマンド及びshow portコマンドで確認

確かにポートは3つ(マネージメントを含むと4つ)しかないですね~(^^;)
 ですが勉強用には十分かと!!

 

④ ホストPCからVEXOSにSSHでアクセス
 ア EXOSにおいて管理者パスワードを設定します。

EXOS-VM.4 # confugure account admin password (Enterキーを叩く)
Current user's password;  (デフォルトでパスワード無しにつきEnterキー叩く)
New password; root123 (パスワードを入力)
Reenter password: root123 (パスワードを入力)
EXOS-VM.4 #
EXOS-VM.4 #save

今回はわかりやすいパスワードで(;^_^A


イ EXOSにおいてSSH設定を有効化します
EXOS-VM.4# enable ssh2
WARNING: Generating new server host key
This could take up to 1 minute and cannot be cancelled. Continue? (y/N) yキーを叩く

Key Generated.
EXOS-VM.4#
EXOS-VM.4 #save 

 


エ VEXOSにログインしてshow vlanコマンドによりMgmtに付与されている

  IPアドレスを確認します
 
EXOS-VM.1 # show vlan
Untagged ports auto-move: Inform
-----------------------------------------------------------------------------------------------
Name            VID  Protocol Addr       Flags                         Proto  Ports  Virtual
                                                                              Active router
                                                                              /Total
-----------------------------------------------------------------------------------------------
Default         1    --------------------------------T-------------    ANY    1 /3   VR-Default
Mgmt            4095 192.168.56.104 /24  --------------------------    ANY    1 /1   VR-Mgmt
-----------------------------------------------------------------------------------------------
Flags : (B) BFD Enabled, (c) 802.1ad customer VLAN, (C) EAPS Control VLAN,
        (d) Dynamically created VLAN, (D) VLAN Admin Disabled,
        (E) ESRP Enabled, (f) IP Forwarding Enabled,
        (F) Learning Disabled, (i) ISIS Enabled,
        (I) Inter-Switch Connection VLAN for MLAG, (k) PTP Configured,
        (l) MPLS Enabled, (L) Loopback Enabled, (m) IPmc Forwarding Enabled,
        (M) Translation Member VLAN or Subscriber VLAN, (n) IP Multinetting Enabled,
        (N) Network Login VLAN, (o) OSPF Enabled, (O) Virtual Network Overlay,
        (p) PIM Enabled, (P) EAPS protected VLAN, (r) RIP Enabled,
        (R) Sub-VLAN IP Range Configured, (s) Sub-VLAN, (S) Super-VLAN,
        (t) Translation VLAN or Network VLAN, (T) Member of STP Domain,
        (v) VRRP Enabled, (V) VPLS Enabled, (W) VPWS Enabled,
        (Y) Policy Enabled

Total number of VLAN(s) : 2
EXOS-VM.2 #


EXOSはVirtualルータがデフォルトで2つ設定されておりMgmtが分離されているようですね

 

オ ホスト(Windows)からsshにアクセスしVEXOSにログインします

 

C:\Users\ユーザー>ssh admin@192.168.56.104
admin@192.168.56.104's password:
ExtremeXOS
Copyright (C) 1996-2020 Extreme Networks. All rights reserved.
This product is protected by one or more US patents listed at https://www.extremenetworks.com/company/legal/patents/ along with their foreign counterparts.
==============================================================================


Press the <tab> or '?' key at any time for completions.
Remember to save your configuration changes.

There have been 6 successful logins since last reboot and 0 failed logins since last successful login
Last successful login was on: Sat Oct 14 01:31:07 2023

 

EXOS-VM.1 #

複数作成する場合は最初からインストールでもよいですが、この時点で仮想マシン

クローンを複数作成しておけば良いですよね(^^;)

基本設定は以下のサイトでCiscoとの対比を載せていただいてますのでご参考に~
(親切ですね!)

https://www.moto-lab.net/entry/2020/02/22/221611
https://www.moto-lab.net/entry/2020/02/23/133430
https://www.moto-lab.net/entry/2020/02/24/132325

 

昔はExtreme製品結構見かけましたよね~ 紫のBODYがかっこよかった~
今後はJunosと並行してEXOS関連も載せていきたいと思います(^^;)!!!

 


よろしくお願いいたします~(^^;)

Juniper BGPにおけるcommunity設定と確認

お疲れさまです~
暑いですね・・(^^;)
今回はBGPにおけるcommunity設定および確認をします(^^;)

お品書きです~
① communityとは??
② communityを使用したLocalPreferrence値の制御及び確認

では始めます~

 

① communityとは??


https://www.infraexpert.com/study/bgpz26.html
いつもながらのサイトです~

こちらもチラ見して勉強。。(なかなかBGPを実運用しないと生きたノウハウはつかないですね・・(^^;))
https://www.nic.ad.jp/ja/materials/iw/2016/proceedings/t06/t6-kojima.pdf

 

② communityを使用したLocalPreferrence値の制御及び確認

Juniperさんの以下のサイトを参考にさせていただきました!!
https://www.juniper.net/documentation/jp/ja/software/junos/routing-policy/topics/example/bgp-communities.html

 

今回はAS65100のCISCOルータからBGPで広報されてくる経路をCOREにおいてcommunity値を付与
 → POD5/6においてCOREから広報されたcommunityによりLocal-preference

   を変更してみます!

構成イメージ図

物理構成図

実施手順

ア 事前確認
 POD5/6においてCISCOからのBGP経路の学習状況を確認します。

POD5
admin@SRX100H2> show route table VR2.inet.0 protocol bgp

VR2.inet.0: 19 destinations, 26 routes (19 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

1.1.1.1/32         *[BGP/170] 00:06:37, localpref 100, from 2.2.2.2
                      AS path: 65000 I
                    > to 172.16.5.1 via fe-0/0/0.0
                    [BGP/170] 00:06:11, localpref 100, from 50.6.1.1
                      AS path: 65000 I
                    > to 172.30.3.6 via fe-0/0/1.0
                      to 172.30.30.6 via fe-0/0/2.0
2.2.2.2/32          [BGP/170] 00:06:37, localpref 100, from 2.2.2.2
                      AS path: 65000 I
                    > to 172.16.5.1 via fe-0/0/0.0
10.1.6.0/24         [BGP/170] 00:06:39, localpref 100, from 50.6.1.1
                      AS path: I
                      to 172.30.3.6 via fe-0/0/1.0
                    > to 172.30.30.6 via fe-0/0/2.0
172.16.200.0/24    *[BGP/170] 00:06:37, localpref 100, from 2.2.2.2
                      AS path: 65000 I
                    > to 172.16.5.1 via fe-0/0/0.0
                    [BGP/170] 00:06:11, localpref 100, from 50.6.1.1
                      AS path: 65000 I
                    > to 172.30.3.6 via fe-0/0/1.0
                      to 172.30.30.6 via fe-0/0/2.0
200.200.200.0/24   *[BGP/170] 00:06:11, localpref 200, from 50.6.1.1   

        ↑ POD6からのLP値は200
                      AS path: 65000 65100 I
                      to 172.30.3.6 via fe-0/0/1.0
                    > to 172.30.30.6 via fe-0/0/2.0
                    [BGP/170] 00:06:37, localpref 100, from 2.2.2.2    

        ↑  COREからのLP値は100
                      AS path: 65000 65100 I
                    > to 172.16.5.1 via fe-0/0/0.0
210.210.210.0/24   *[BGP/170] 00:06:37, localpref 100, from 2.2.2.2
                      AS path: 65000 65100 I
                    > to 172.16.5.1 via fe-0/0/0.0
                    [BGP/170] 00:06:11, localpref 100, from 50.6.1.1
                      AS path: 65000 65100 I
                    > to 172.30.3.6 via fe-0/0/1.0
                      to 172.30.30.6 via fe-0/0/2.0
220.220.220.0/24   *[BGP/170] 00:06:37, localpref 100, from 2.2.2.2
                      AS path: 65000 65100 I
                    > to 172.16.5.1 via fe-0/0/0.0
                    [BGP/170] 00:06:11, localpref 100, from 50.6.1.1
                      AS path: 65000 65100 I
                      to 172.30.3.6 via fe-0/0/1.0
                    > to 172.30.30.6 via fe-0/0/2.0

admin@SRX100H2>

admin@SRX100H2> show route table VR1.inet.0 protocol bgp

VR1.inet.0: 19 destinations, 25 routes (19 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

1.1.1.1/32         *[BGP/170] 00:16:05, localpref 100, from 2.2.2.2
                      AS path: 65000 I
                    > to 172.16.6.1 via fe-0/0/4.0
                    [BGP/170] 00:16:31, localpref 100, from 50.5.1.1
                      AS path: 65000 I
                    > to 172.16.6.1 via fe-0/0/4.0
2.2.2.2/32          [BGP/170] 00:16:05, localpref 100, from 2.2.2.2
                      AS path: 65000 I
                    > to 172.16.6.1 via fe-0/0/4.0
10.1.5.0/24         [BGP/170] 00:16:33, localpref 100, from 50.5.1.1
                      AS path: I
                      to 172.30.3.5 via fe-0/0/5.0
                    > to 172.30.30.5 via fe-0/0/6.0
172.16.200.0/24    *[BGP/170] 00:16:05, localpref 100, from 2.2.2.2
                      AS path: 65000 I
                    > to 172.16.6.1 via fe-0/0/4.0
                    [BGP/170] 00:16:31, localpref 100, from 50.5.1.1
                      AS path: 65000 I
                    > to 172.16.6.1 via fe-0/0/4.0
200.200.200.0/24   *[BGP/170] 00:16:05, localpref 200, from 2.2.2.2  

             ↑ COREからのLP値は200
                      AS path: 65000 65100 I
                    > to 172.16.6.1 via fe-0/0/4.0
210.210.210.0/24   *[BGP/170] 00:16:05, localpref 100, from 2.2.2.2
                      AS path: 65000 65100 I
                    > to 172.16.6.1 via fe-0/0/4.0
                    [BGP/170] 00:16:30, localpref 100, from 50.5.1.1
                      AS path: 65000 65100 I
                    > to 172.16.6.1 via fe-0/0/4.0
220.220.220.0/24   *[BGP/170] 00:16:05, localpref 100, from 2.2.2.2
                      AS path: 65000 65100 I
                    > to 172.16.6.1 via fe-0/0/4.0
                    [BGP/170] 00:16:30, localpref 100, from 50.5.1.1
                      AS path: 65000 65100 I
                    > to 172.16.6.1 via fe-0/0/4.0

 

前回のLocal-preference設定がついているようですね・・(^^;)


で現状の設定を確認しました~

POD5
admin@SRX100H2> show configuration routing-instances VR2 protocols bgp
group INTERNAL {
    type internal;
    local-address 50.5.1.1;
    export INTERNAL-NETWORK-VR2;
    peer-as 65001;
    neighbor 50.6.1.1;
}
group EXTERNAL {
    type external;
    local-address 50.5.1.1;
    inactive: import LOCAL-PREF;      → LP値設定はInactive(無効化)
    export [ ADV-ROUTE01 INTERNAL-NETWORK-VR2 INTERNAL-NETWORK-VR1 ];
    peer-as 65000;
    neighbor 2.2.2.2 {
        multihop {
            ttl 2;
        }
    }
}

admin@SRX100H2>

POD6

admin@SRX100H2> show configuration routing-instances VR1 protocols bgp
group INTERNAL {
    type internal;
    local-address 50.6.1.1;
    export [ INTERNAL-NETWORK-VR1 NEXT-HOP ];
    peer-as 65001;
    neighbor 50.5.1.1;
}
group EXTERNAL {
    type external;
    local-address 50.6.1.1;
    import LOCAL-PREF;                           → LP値設定はActivate(有効化)
    export [ ADV-ROUTE06 INTERNAL-NETWORK-VR1 INTERNAL-NETWORK-VR2 ];
    peer-as 65000;
    neighbor 2.2.2.2 {
        multihop {
            ttl 2;
        }
    }
}

admin@SRX100H2>


LP値の設定Policy

admin@SRX100H2> show configuration policy-options policy-statement LOCAL-PREF | display set
set policy-options policy-statement LOCAL-PREF term 1 from route-filter 200.200.200.0/24 exact
set policy-options policy-statement LOCAL-PREF term 1 then local-preference 200


なので。。。以下でLP値設定を削除しておきます~(Policyは残したまま。。)


admin@SRX100H2# delete routing-instances VR1 protocols bgp group EXTERNAL import LOCAL-PREF
admin@SRX100H2# delete routing-instances VR2 protocols bgp group EXTERNAL import LOCAL-PREF

[edit]
admin@SRX100H2# show | compare
[edit routing-instances VR1 protocols bgp group EXTERNAL]
-      import LOCAL-PREF;
[edit routing-instances VR2 protocols bgp group EXTERNAL]
-      inactive: import LOCAL-PREF;

[edit]
admin@SRX100H2#

admin@SRX100H2> clear bgp neighbor soft-inbound instance VR1

admin@SRX100H2> clear bgp neighbor soft-inbound instance VR2

admin@SRX100H2>


admin@SRX100H2> show route table VR2.inet.0 protocol bgp 200.200.200.0/24

VR2.inet.0: 19 destinations, 26 routes (19 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

200.200.200.0/24   *[BGP/170] 00:30:15, localpref 100, from 2.2.2.2
                      AS path: 65000 65100 I
                    > to 172.16.5.1 via fe-0/0/0.0
                    [BGP/170] 00:01:34, localpref 100, from 50.6.1.1
                      AS path: 65000 65100 I
                      to 172.30.3.6 via fe-0/0/1.0
                    > to 172.30.30.6 via fe-0/0/2.0

admin@SRX100H2> show route table VR1.inet.0 protocol bgp 200.200.200.0/24

VR1.inet.0: 19 destinations, 26 routes (19 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

200.200.200.0/24   *[BGP/170] 00:29:53, localpref 100, from 2.2.2.2
                      AS path: 65000 65100 I
                    > to 172.16.6.1 via fe-0/0/4.0
                    [BGP/170] 00:01:38, localpref 100, from 50.5.1.1
                      AS path: 65000 65100 I
                    > to 172.16.6.1 via fe-0/0/4.0

admin@SRX100H2>


LP値がデフォルトに戻りました~

 

イ CORE及びPOD5/6にcommunity関連の設定を投入します。

【COREの設定】
 AS65100のCISCOルータからBGPで広報されてくる経路をCOREにおいて

 communityを付与

set policy-options policy-statement AS65100-Seg-control term 1 from route-filter 200.200.200.0/24 exact
set policy-options policy-statement AS65100-Seg-control term 1 then community add CISCO_SEG1
set policy-options policy-statement AS65100-Seg-control term 1 then accept
set policy-options policy-statement AS65100-Seg-control term 2 from route-filter 210.210.210.0/24 exact
set policy-options policy-statement AS65100-Seg-control term 2 from route-filter 220.220.220.0/24 exact
set policy-options policy-statement AS65100-Seg-control term 2 then community add CISCO_SEG10
set policy-options policy-statement AS65100-Seg-control term 2 then accept

set policy-options community CISCO_SEG1 members 65100:1
set policy-options community CISCO_SEG10 members 65100:10

set routing-instances VR2 protocols bgp group EXTERNAL-AS65100 import AS65100-Seg-control

 

〇 POD5/6においてcommunityの条件によりLocal-preferenceを変更する設定

【POD5の設定】
set policy-options policy-statement change-local-preference-POD5 term 1 from community CISCO_SEG1-LP
set policy-options policy-statement change-local-preference-POD5 term 1 then local-preference 200
set policy-options policy-statement change-local-preference-POD5 term 2 from community CISCO_SEG10-LP
set policy-options policy-statement change-local-preference-POD5 term 2 then local-preference 50
set policy-options community CISCO_SEG1-LP members 65100:1
set policy-options community CISCO_SEG10-LP members 65100:10
set routing-instance VR2 protocols bgp group EXTERNAL import change-local-preference-POD5


【POD6の設定】

set policy-options policy-statement change-local-preference-POD6 term 1 from community CISCO_SEG1-LP
set policy-options policy-statement change-local-preference-POD6 term 1 then local-preference 50
set policy-options policy-statement change-local-preference-POD6 term 2 from community CISCO_SEG10-LP
set policy-options policy-statement change-local-preference-POD6 term 2 then local-preference 200
set policy-options community CISCO_SEG1-LP members 65100:1
set policy-options community CISCO_SEG10-LP members 65100:10
set routing-instance VR1 protocols bgp group EXTERNAL import change-local-preference-POD6

 

〇 COREでBGPネイバーをリセットします。
admin@SRX100B> clear bgp neighbor soft-inbound instance VR1
admin@SRX100B> clear bgp neighbor soft-inbound instance VR2


エ communityによる制御が実施されているかを確認します。
 ア) COREからcommunityを広報しているかを確認!

admin@SRX100B> show route advertising-protocol bgp 50.5.1.1 extensive 

VR2.inet.0: 15 destinations, 18 routes (15 active, 0 holddown, 0 hidden)
* 1.1.1.1/32 (2 entries, 1 announced)
 BGP group EXTERNAL type External
     Nexthop: Self
     AS path: [65000] I

* 2.2.2.2/32 (1 entry, 1 announced)
 BGP group EXTERNAL type External
     Nexthop: Self
     AS path: [65000] I

* 172.16.200.0/24 (1 entry, 1 announced)
 BGP group EXTERNAL type External
     Nexthop: Self
     AS path: [65000] I

* 200.200.200.0/24 (1 entry, 1 announced)
 BGP group EXTERNAL type External
     Nexthop: Self
     AS path: [65000] 65100 I
     Communities: 65100:1

* 210.210.210.0/24 (1 entry, 1 announced)
 BGP group EXTERNAL type External
     Nexthop: Self
     AS path: [65000] 65100 I
     Communities: 65100:10

* 220.220.220.0/24 (1 entry, 1 announced)
 BGP group EXTERNAL type External
     Nexthop: Self
     AS path: [65000] 65100 I
     Communities: 65100:10


200.200.200.0/24 ~ 220.220.220.0/24のサブネットに

           Communitiesが付加されているのがわかりますね~


 イ) POD5/6においてcommunity(タグ)の条件により
               Local-preferenceが変更されているかを確認
admin@SRX100H2> show route table VR1.inet.0 protocol bgp 

VR1.inet.0: 19 destinations, 24 routes (19 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

1.1.1.1/32         *[BGP/170] 00:42:42, localpref 100, from 2.2.2.2
                      AS path: 65000 I
                    > to 172.16.6.1 via fe-0/0/4.0
                    [BGP/170] 00:42:46, localpref 100, from 50.5.1.1
                      AS path: 65000 I
                    > to 172.16.6.1 via fe-0/0/4.0
2.2.2.2/32          [BGP/170] 00:42:42, localpref 100, from 2.2.2.2
                      AS path: 65000 I
                    > to 172.16.6.1 via fe-0/0/4.0
10.1.5.0/24         [BGP/170] 00:42:46, localpref 100, from 50.5.1.1
                      AS path: I
                      to 172.30.3.5 via fe-0/0/5.0
                    > to 172.30.30.5 via fe-0/0/6.0
172.16.200.0/24    *[BGP/170] 00:42:42, localpref 100, from 2.2.2.2
                      AS path: 65000 I
                    > to 172.16.6.1 via fe-0/0/4.0
                    [BGP/170] 00:42:46, localpref 100, from 50.5.1.1
                      AS path: 65000 I
                    > to 172.16.6.1 via fe-0/0/4.0
200.200.200.0/24   *[BGP/170] 00:09:26, localpref 200, from 50.5.1.1
                      AS path: 65000 65100 I
                    > to 172.16.6.1 via fe-0/0/4.0
                    [BGP/170] 00:30:13, localpref 50, from 2.2.2.2
                      AS path: 65000 65100 I
                    > to 172.16.6.1 via fe-0/0/4.0
210.210.210.0/24   *[BGP/170] 00:30:13, localpref 200, from 2.2.2.2
                      AS path: 65000 65100 I
                    > to 172.16.6.1 via fe-0/0/4.0
220.220.220.0/24   *[BGP/170] 00:30:13, localpref 200, from 2.2.2.2
                      AS path: 65000 65100 I
                    > to 172.16.6.1 via fe-0/0/4.0

admin@SRX100H2> admin@SRX100H2> show route table VR2.inet.0 protocol bgp 

VR2.inet.0: 19 destinations, 25 routes (19 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

1.1.1.1/32         *[BGP/170] 00:43:15, localpref 100, from 2.2.2.2
                      AS path: 65000 I
                    > to 172.16.5.1 via fe-0/0/0.0
                    [BGP/170] 00:43:00, localpref 100, from 50.6.1.1
                      AS path: 65000 I
                    > to 172.30.3.6 via fe-0/0/1.0
                      to 172.30.30.6 via fe-0/0/2.0
2.2.2.2/32          [BGP/170] 00:43:15, localpref 100, from 2.2.2.2
                      AS path: 65000 I
                    > to 172.16.5.1 via fe-0/0/0.0
10.1.6.0/24         [BGP/170] 00:43:04, localpref 100, from 50.6.1.1
                      AS path: I
                      to 172.30.3.6 via fe-0/0/1.0
                    > to 172.30.30.6 via fe-0/0/2.0
172.16.200.0/24    *[BGP/170] 00:43:15, localpref 100, from 2.2.2.2
                      AS path: 65000 I
                    > to 172.16.5.1 via fe-0/0/0.0
                    [BGP/170] 00:43:00, localpref 100, from 50.6.1.1
                      AS path: 65000 I
                    > to 172.30.3.6 via fe-0/0/1.0
                      to 172.30.30.6 via fe-0/0/2.0
200.200.200.0/24   *[BGP/170] 00:30:31, localpref 200, from 2.2.2.2
                      AS path: 65000 65100 I
                    > to 172.16.5.1 via fe-0/0/0.0
210.210.210.0/24   *[BGP/170] 00:09:44, localpref 200, from 50.6.1.1
                      AS path: 65000 65100 I
                    > to 172.30.3.6 via fe-0/0/1.0
                      to 172.30.30.6 via fe-0/0/2.0
                    [BGP/170] 00:30:31, localpref 50, from 2.2.2.2
                      AS path: 65000 65100 I
                    > to 172.16.5.1 via fe-0/0/0.0
220.220.220.0/24   *[BGP/170] 00:09:44, localpref 200, from 50.6.1.1
                      AS path: 65000 65100 I
                      to 172.30.3.6 via fe-0/0/1.0
                    > to 172.30.30.6 via fe-0/0/2.0
                    [BGP/170] 00:30:31, localpref 50, from 2.2.2.2
                      AS path: 65000 65100 I
                    > to 172.16.5.1 via fe-0/0/0.0

★extensiveオプションをつけるとより詳細な情報がわかります!

admin@SRX100H2>show route table VR1.inet.0 protocol bgp 200.200.200.0/24 extensive | no-more 

VR1.inet.0: 19 destinations, 24 routes (19 active, 0 holddown, 0 hidden)
210.210.210.0/24 (1 entry, 1 announced)
TSI:
KRT in-kernel 210.210.210.0/24 -> {indirect(262144)}
Page 0 idx 0 Type 1 val 15ad570
    Flags: Nexthop Change
    Nexthop: Self
    Localpref: 200
    AS path: [65001] 65000 65100 I
    Communities: 65100:10
Path 210.210.210.0 from 2.2.2.2 Vector len 4.  Val: 0
        *BGP    Preference: 170/-201
                Next hop type: Indirect
                Address: 0x15b13a8
                Next-hop reference count: 19
                Source: 2.2.2.2
                Next hop type: Router, Next hop index: 1404
                Next hop: 172.16.6.1 via fe-0/0/4.0, selected
                Protocol next hop: 2.2.2.2
                Indirect next hop: 16802b8 262144
                State: <Active Ext>
                Local AS: 65001 Peer AS: 65000
                Age: 29:08      Metric2: 0 
                Task: BGP_65000_65001.2.2.2.2+179
                Announcement bits (3): 2-KRT 3-BGP_RT_Background 4-Resolve tree 2 
                AS path: 65000 65100 I
                Communities: 65100:10
                Accepted
                Localpref: 200
                Router ID: 1.1.1.1
                Indirect next hops: 1
                        Protocol next hop: 2.2.2.2
                        Indirect next hop: 16802b8 262144
                        Indirect path forwarding next hops: 1
                                Next hop type: Router
                                Next hop: 172.16.6.1 via fe-0/0/4.0
                        2.2.2.2/32 Originating RIB: VR1.inet.0
                          Node path count: 1
                          Forwarding nexthops: 1
                                Nexthop: 172.16.6.1 via fe-0/0/4.0

admin@SRX100H2> show route table VR1.inet.0 protocol bgp 210.210.210.0/24 extensive | no-more    

VR1.inet.0: 19 destinations, 24 routes (19 active, 0 holddown, 0 hidden)
220.220.220.0/24 (1 entry, 1 announced)
TSI:
KRT in-kernel 220.220.220.0/24 -> {indirect(262144)}
Page 0 idx 0 Type 1 val 15ad58c
    Flags: Nexthop Change
    Nexthop: Self
    Localpref: 200
    AS path: [65001] 65000 65100 I
    Communities: 65100:10
Path 220.220.220.0 from 2.2.2.2 Vector len 4.  Val: 0
        *BGP    Preference: 170/-201
                Next hop type: Indirect
                Address: 0x15b13a8
                Next-hop reference count: 19
                Source: 2.2.2.2
                Next hop type: Router, Next hop index: 1404
                Next hop: 172.16.6.1 via fe-0/0/4.0, selected
                Protocol next hop: 2.2.2.2
                Indirect next hop: 16802b8 262144
                State: <Active Ext>
                Local AS: 65001 Peer AS: 65000
                Age: 29:18      Metric2: 0 
                Task: BGP_65000_65001.2.2.2.2+179
                Announcement bits (3): 2-KRT 3-BGP_RT_Background 4-Resolve tree 2 
                AS path: 65000 65100 I
                Communities: 65100:10
                Accepted
                Localpref: 200
                Router ID: 1.1.1.1
                Indirect next hops: 1
                        Protocol next hop: 2.2.2.2
                        Indirect next hop: 16802b8 262144
                        Indirect path forwarding next hops: 1
                                Next hop type: Router
                                Next hop: 172.16.6.1 via fe-0/0/4.0
                        2.2.2.2/32 Originating RIB: VR1.inet.0
                          Node path count: 1
                          Forwarding nexthops: 1
                                Nexthop: 172.16.6.1 via fe-0/0/4.0

admin@SRX100H2> show route table VR1.inet.0 protocol bgp 220.220.220.0/24 extensive | no-more 

VR2.inet.0: 19 destinations, 25 routes (19 active, 0 holddown, 0 hidden)
200.200.200.0/24 (1 entry, 1 announced)
TSI:
KRT in-kernel 200.200.200.0/24 -> {indirect(262142)}
Page 0 idx 1 Type 1 val 15ad2d0
    Nexthop: 2.2.2.2
    Localpref: 200
    AS path: [65001] 65000 65100 I
    Communities: 65100:1
Path 200.200.200.0 from 2.2.2.2 Vector len 4.  Val: 1
        *BGP    Preference: 170/-201
                Next hop type: Indirect
                Address: 0x15b1194
                Next-hop reference count: 12
                Source: 2.2.2.2
                Next hop type: Router, Next hop index: 1403
                Next hop: 172.16.5.1 via fe-0/0/0.0, selected
                Protocol next hop: 2.2.2.2
                Indirect next hop: 16803a0 262142
                State: <Active Ext>
                Local AS: 65001 Peer AS: 65000
                Age: 29:35      Metric2: 0 
                Task: BGP_65000_65001.2.2.2.2+53582
                Announcement bits (3): 2-KRT 3-BGP_RT_Background 4-Resolve tree 1 
                AS path: 65000 65100 I
                Communities: 65100:1
                Accepted
                Localpref: 200
                Router ID: 1.1.1.1
                Indirect next hops: 1
                        Protocol next hop: 2.2.2.2
                        Indirect next hop: 16803a0 262142
                        Indirect path forwarding next hops: 1
                                Next hop type: Router
                                Next hop: 172.16.5.1 via fe-0/0/0.0
                        2.2.2.2/32 Originating RIB: VR2.inet.0
                          Node path count: 1
                          Forwarding nexthops: 1
                                Nexthop: 172.16.5.1 via fe-0/0/0.0

 

 

 

次回はBGPルートリフレクタ及びルートコンフィでレーションの設定と確認をしたいと思います(^^;)
       → 久しぶりにSRX240で実施してみようかな~
   
                  ではまたまた~(^^;)

 

 

 

Juniper BGPにおけるAS_Pathフィルタリング設定と確認

お疲れさまです~
今回はBGPにおけるAS_Pathフィルタリングについて設定および確認をします(^^;)

お品書きです~
① AS_Pathフィルタリングとは?
② AS_Pathフィルタリングの設定および確認
 (1) 特定のASのみの経路を受信する設定と確認
 (2) 非トランジットASの設定と確認

では始めます~

 

① AS_Pathフィルタリングとは?

AS_Pathフィルタリングとは??



 

www.infraexpert.com

www.infraexpert.com


いつものサイトでございます~

Juniperサイトも参考にしました~
  

www.juniper.net

 

② AS_Pathフィルタリングの設定
  いつもの構成で以下を実施します

 (1) 特定のASのみの経路を受信する設定と確認
 (2) 非トランジットASの設定と確認

 

(1) 特定のASのみの経路を受信する設定と確認

構成図

実施手順

フィルタ適用前のルーティングテーブル

AS65100からの経路を受信しない設定を投入します!

・BGPピアをクリアした後、確認してみましょう!

[edit]
admin@SRX100B# run clear bgp neighbor soft-inbound instance VR2


[edit]
admin@SRX100B# run show route table VR2.inet.0 protocol bgp

VR2.inet.0: 14 destinations, 16 routes (11 active, 0 holddown, 4 hidden)
+ = Active Route, - = Last Active, * = Both

10.1.6.0/24        *[BGP/170] 00:37:35, MED 10, localpref 100, from 50.6.1.1
                      AS path: 65001 I
                    > to 172.16.6.254 via fe-0/0/2.0
                    [BGP/170] 00:37:27, MED 20, localpref 100, from 50.5.1.1
                      AS path: 65001 I
                    > to 172.16.5.254 via fe-0/0/1.0

→ Cisco(AS65100)からのBGP経路が受信されなくなりました

(フィルタされています!)

[edit]
admin@SRX100B# run show route receive-protocol bgp 172.16.210.1

inet.0: 1 destinations, 1 routes (1 active, 0 holddown, 0 hidden)

VR1.inet.0: 14 destinations, 17 routes (14 active, 0 holddown, 0 hidden)

VR2.inet.0: 14 destinations, 16 routes (11 active, 0 holddown, 4 hidden)

[edit]
admin@SRX100B#

  → 当たり前ですがCiscoからのBGP経路をこちらでも受信できていない

  ことが確認できますね!

 

お次にいきましょう~(^^;)

(2) 非トランジットASの設定と確認

構成図

実施手順

・(1)で設定したポリシーを削除します

[edit]
admin@SRX100B# delete routing-instances VR2 protocols bgp group EXTERNAL-AS65100 import AS-FILTER-65100

[edit]
admin@SRX100B# commit check
configuration check succeeds

[edit]
admin@SRX100B# commit
commit complete

・BGPピアをクリアした後、確認してみましょう!

[edit]
admin@SRX100B# run clear bgp neighbor soft-inbound instance VR2

[edit]
admin@SRX100B# run show route table VR2.inet.0 protocol bgp

VR2.inet.0: 14 destinations, 16 routes (14 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

1.1.1.1/32          [BGP/170] 00:17:53, localpref 100
                      AS path: 65100 I
                    > to 172.16.200.1 via fe-0/0/0.0
10.1.6.0/24        *[BGP/170] 00:16:11, MED 10, localpref 100, from 50.6.1.1
                      AS path: 65001 I
                    > to 172.16.6.254 via fe-0/0/2.0
                    [BGP/170] 00:16:37, MED 20, localpref 100, from 50.5.1.1
                      AS path: 65001 I
                    > to 172.16.5.254 via fe-0/0/1.0
200.200.200.0/24   *[BGP/170] 00:17:53, localpref 100
                      AS path: 65100 I
                    > to 172.16.200.1 via fe-0/0/0.0
210.210.210.0/24   *[BGP/170] 00:17:53, localpref 100
                      AS path: 65100 I
                    > to 172.16.200.1 via fe-0/0/0.0
220.220.220.0/24   *[BGP/170] 00:17:53, localpref 100
                      AS path: 65100 I
                    > to 172.16.200.1 via fe-0/0/0.0

Cisco(AS65100)からのBGP経路が受信できていますよね~

 

設定前確認~

設定内容


設定後、BGPピアをクリアにします。
 admin@SRX100B>clear bgp neihgbor soft-inbound

設定後の確認

〇このままほっておくと忘れそうなので。。先ほどの”ONLY-MYROUTE”を
exportしたところだけを削除。。

[edit routing-instances VR2 protocols bgp group EXTERNAL-AS65100]
admin@SRX100B# delete export ONLY-MYROUTE


[edit routing-instances VR2 protocols bgp group EXTERNAL-AS65100]
admin@SRX100B# run clear bgp neighbor soft-inbound instance VR2

[edit routing-instances VR2 protocols bgp group EXTERNAL-AS65100]
admin@SRX100B# run show route advertising-protocol bgp 172.16.200.1

VR2.inet.0: 15 destinations, 18 routes (15 active, 0 holddown, 0 hidden)
  Prefix                  Nexthop              MED     Lclpref    AS path
* 2.2.2.2/32              Self                                    I
* 10.1.5.0/24             Self                                    65001 I
* 10.1.6.0/24             Self                                    65001 I

[edit routing-instances VR2 protocols bgp group EXTERNAL-AS65100]
admin@SRX100B# run show route receive-protocol bgp 172.16.200.254

inet.0: 1 destinations, 1 routes (1 active, 0 holddown, 0 hidden)

VR1.inet.0: 15 destinations, 18 routes (15 active, 0 holddown, 0 hidden)
  Prefix                  Nexthop              MED     Lclpref    AS path
* 2.2.2.2/32              172.16.200.254                          65000 I
* 10.1.5.0/24             172.16.200.254                          65000 65001 I
* 10.1.6.0/24             172.16.200.254                          65000 65001 I

VR2.inet.0: 15 destinations, 18 routes (15 active, 0 holddown, 0 hidden)

 

 

 

BGPは奥深い。。
まだまだ勉強足りないな。。(;^_^A

次回はcommunity値を活用した経路制御について書きたいと思います(^^;)
 

 

 

 

 

JuniperのBGP設定におけるMED値設定と確認

お疲れさまです。。
今回はBGP設定におけるMED値設定と確認を実施したいと思います~(^^;)

お品書きです~
① MEDの概要
② 設定追加及び確認
 10.1.5.0/24及び10.1.6.0/24をEBGPにより広告、確認
③ MED値を明示的に設定及び確認

では始めます~

 

① MEDの概要

いつもながらサイト ”ネットワークエンジニアとして”は分かりやすく良いですね!!

www.infraexpert.com

MEDの概要

【MED設定時における経路広告】

【MED設定時におけるパケットフロー】

② 設定追加及び確認

  ではMED値の設定および確認をしていきます!!

  構成はいつも馴染み??の構成です~

 

【構成図その1】

【構成図その2】

【実施要領】

事前設定

↑の設定後、BGPネイバーをクリアしてCORE側で経路が広告されていることを確認しました~

 

admin@SRX100B> clear bgp neighbor soft-inbound instance VR2

admin@SRX100B> show route 10.1.5.0/24

VR1.inet.0: 15 destinations, 18 routes (15 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

10.1.5.0/24        *[BGP/170] 00:15:25, localpref 100
                      AS path: 65000 65001 I
                    > to 172.16.200.254 via fe-0/0/3.0

VR2.inet.0: 15 destinations, 18 routes (15 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

10.1.5.0/24        *[BGP/170] 00:15:25, localpref 100, from 50.5.1.1
                      AS path: 65001 I
                    > to 172.16.5.254 via fe-0/0/1.0
                    [BGP/170] 00:01:23, MED 2, localpref 100, from 50.6.1.1
                      AS path: 65001 I
                    > to 172.16.6.254 via fe-0/0/2.0

admin@SRX100B> show route 10.1.6.0/24

VR1.inet.0: 15 destinations, 18 routes (15 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

10.1.6.0/24        *[BGP/170] 00:15:21, localpref 100
                      AS path: 65000 65001 I
                    > to 172.16.200.254 via fe-0/0/3.0

VR2.inet.0: 15 destinations, 18 routes (15 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

10.1.6.0/24        *[BGP/170] 00:15:17, localpref 100, from 50.6.1.1
                      AS path: 65001 I
                    > to 172.16.6.254 via fe-0/0/2.0
                    [BGP/170] 00:06:48, MED 2, localpref 100, from 50.5.1.1
                      AS path: 65001 I
                    > to 172.16.5.254 via fe-0/0/1.0

admin@SRX100B>

 

次にPOD5/6においてMED値を設定しました!!

以下のサイトも今回は参考に~

www.juniper.net

【MED値の設定】

設定後、BGPネイバーをクリアーしてMED値が広告されているかを確認しましたよ

admin@SRX100B> clear bgp neighbor soft-inbound instance VR2

 

POD5/6からのBGPアドバタイズ

COREにおける経路受信確認(MED値も確認)

最後にMED値が少ない経路に通信できるかも確認!

 

次回は AS_Pathによるフィルタリング設定と確認を予定しています~(^^;)

 

JuniperのBGP設定におけるLocal-Preference設定と確認

お疲れさまです。。
バタバタしていて最近ブログを更新できてませんでした・・(^^;)

BGP設定におけるLocal-Preferenceの設定と確認を実施したいと思います~

【お品書き】

① Local-preferenceとは?

② Local-preference値の変更及び確認

1 バックアップしていたBGP設定に戻す
2 Ciscoルータが持つネットワーク

   (200.200.200.0/24、210.210.210.0/24、220.220.220.0/24)
  をEBGPで広告する設定を実施します。
 △ Staticルートで1.1.1.1向けのルートを確保する
    POD5/6はデフォルトルートを上位に向ける
    COREは個別ルートを設定
3 Local-Preferenceを設定し、適用します。
  POD6において200.200.200.0/24に対するLocal-Preferenceを設定し、適用します。 
4 設定後、経路情報を確認します。

 

では始めます~

① Local-preferenceとは?

② Local-preference値の変更及び確認

 

1 バックアップしていたBGP設定に戻す 

前回MPLS-L3設定と確認をしていたのでバックアップしていたBGP設定に戻します~

admin@SRX100B> configure
Entering configuration mode

[edit]
admin@SRX100B# load override ?
Possible completions:
  <filename>           Filename (URL, local, remote, or floppy)
  20230513-BGP-conifg-BU.cfg  Size: 6759, Last changed: May 13 00:32:34
  IBGP-config.cfg      Size: 5051, Last changed: Apr 23 02:10:10
  JSEC-begin-config    Size: 1820, Last changed: Jan 04 09:47:07
  MPLS-L3.cfg          Size: 4005, Last changed: May 13 08:32:46
  Policy-BaseVPN-2.cfg  Size: 5670, Last changed: Mar 21 03:19:58
  Policy-BaseVPN.cfg   Size: 4667, Last changed: Mar 05 05:53:43
  terminal             Use login terminal
[edit]
admin@SRX100B# load override 20230513-BGP-conifg-BU.cfg
load complete

[edit]
admin@SRX100B# commit check
warning: uid changed for admin (2002->2001)
configuration check succeeds

[edit]
admin@SRX100B#

2 Ciscoルータが持つネットワーク

   (200.200.200.0/24、210.210.210.0/24、220.220.220.0/24)
  をEBGPで広告する設定を実施します。


〇AS65100のVR1設定
(現状)
admin@SRX100B> show configuration routing-instances VR1 protocols bgp
inactive: traceoptions {
    file BGP-log;
    flag keepalive;
    flag open;
    flag refresh;
    flag update;
}
group INTERNAL {
    type internal;
    local-address 1.1.1.1;
    export INTERNAL-NETWORK-VR1;
    peer-as 65100;
    neighbor 200.200.200.1;
}
group EXTERNAL {
    type external;
    local-address 172.16.200.1;
    export INTERNAL-NETWORK-VR1;
    peer-as 65000;
    neighbor 172.16.200.254;
}

admin@SRX100B>

admin@SRX100B> show configuration policy-options policy-statement INTERNAL-NETWORK-VR1
term 1 {
    from {
        route-filter 1.1.1.1/32 exact;
    }
    then accept;
}

admin@SRX100B>


〇 設定追加
 ア from-cisco-networkというpolicy-statementを作成
 (route-filterを200.200.200.0/24 210.210.210.0/24 220.220.220.0/24を指定) 
[edit]
admin@SRX100B# run show configuration policy-options policy-statement from-cisco-network
term 1 {
    from {
        route-filter 200.200.200.0/24 exact;
        route-filter 210.210.210.0/24 exact;
        route-filter 220.220.220.0/24 exact;
    }
    then accept;
}

イ BGPのexportに対して①のPolicyをエクスポート
admin@SRX100B> show configuration routing-instances VR1 protocols bgp
inactive: traceoptions {
    file BGP-log;
    flag keepalive;
    flag open;
    flag refresh;
    flag update;
}
group INTERNAL {
    type internal;
    local-address 1.1.1.1;
    export INTERNAL-NETWORK-VR1;
    peer-as 65100;
    neighbor 200.200.200.1;
}
group EXTERNAL {
    type external;
    local-address 172.16.200.1;
    export [ INTERNAL-NETWORK-VR1 from-cisco-network ];
    peer-as 65000;
    neighbor 172.16.200.254;
}

admin@SRX100B>

ウ 経路が広告されていることを確認 

admin@SRX100B> show route advertising-protocol bgp 172.16.200.254

VR1.inet.0: 15 destinations, 18 routes (15 active, 0 holddown, 0 hidden)
  Prefix                  Nexthop              MED     Lclpref    AS path
* 1.1.1.1/32              Self                                    I
* 200.200.200.0/24        Self                                    I
* 210.210.210.0/24        Self                                    I
* 220.220.220.0/24        Self                                    I

admin@SRX100B>

エ 経路が受信されていることを確認

admin@SRX100B> show route receive-protocol bgp 172.16.200.1

inet.0: 1 destinations, 1 routes (1 active, 0 holddown, 0 hidden)

VR1.inet.0: 15 destinations, 18 routes (15 active, 0 holddown, 0 hidden)

VR2.inet.0: 15 destinations, 16 routes (15 active, 0 holddown, 0 hidden)
  Prefix                  Nexthop              MED     Lclpref    AS path
  1.1.1.1/32              172.16.200.1                            65100 I
* 200.200.200.0/24        172.16.200.1                            65100 I
* 210.210.210.0/24        172.16.200.1                            65100 I
* 220.220.220.0/24        172.16.200.1                            65100 I

admin@SRX100B>

〇AS65000のVR2設定
(現状)
admin@SRX100B> show configuration routing-instances VR2 protocols bgp
inactive: traceoptions {
    file BGP-log;
    flag keepalive;
    flag open;
    flag update;
}
group EXTERNAL {
    type external;
    local-address 2.2.2.2;
    export ADV-ROUTE01;
    peer-as 65001;
    neighbor 50.5.1.1 {
        multihop {
            ttl 2;
        }
    }
    neighbor 50.6.1.1 {
        multihop {
            ttl 2;
        }
    }
}
group EXTERNAL-AS65100 {
    type external;
    local-address 172.16.200.254;
    export INTERNAL-NETWORK-VR2;
    peer-as 65100;
    neighbor 172.16.200.1;
}

admin@SRX100B> show configuration policy-options policy-statement ADV-ROUTE01
term 1 {
    from {
        prefix-list ADV-ROUTE;
    }
    then accept;
}


admin@SRX100B> show configuration policy-options prefix-list ADV-ROUTE
1.1.1.1/32;
2.2.2.2/32;
172.16.200.0/24;

admin@SRX100B>

〇設定追加(Ciscoルータが持つ経路をプレフィックスリストに追加)

admin@SRX100B# set policy-options prefix-list ADV-ROUTE 200.200.200.0/24
admin@SRX100B# set policy-options prefix-list ADV-ROUTE 210.210.210.0/24
admin@SRX100B# set policy-options prefix-list ADV-ROUTE 220.220.220.0/24

[edit]
admin@SRX100B# commit check
configuration check succeeds

[edit]
admin@SRX100B# commit
commit complete

〇確認
[edit]
admin@SRX100B# run show configuration policy-options prefix-list ADV-ROUTE
1.1.1.1/32;
2.2.2.2/32;
172.16.200.0/24;
200.200.200.0/24;
210.210.210.0/24;
220.220.220.0/24;

(経路が広告されていることを確認)
admin@SRX100B# run show route advertising-protocol bgp 50.5.1.1

VR2.inet.0: 15 destinations, 16 routes (15 active, 0 holddown, 0 hidden)
  Prefix                  Nexthop              MED     Lclpref    AS path
* 1.1.1.1/32              Self                                    I
* 2.2.2.2/32              Self                                    I
* 172.16.200.0/24         Self                                    I
* 200.200.200.0/24        Self                                    65100 I
* 210.210.210.0/24        Self                                    65100 I
* 220.220.220.0/24        Self                                    65100 I

[edit]
admin@SRX100B# run show route advertising-protocol bgp 50.6.1.1

VR2.inet.0: 15 destinations, 16 routes (15 active, 0 holddown, 0 hidden)
  Prefix                  Nexthop              MED     Lclpref    AS path
* 1.1.1.1/32              Self                                    I
* 2.2.2.2/32              Self                                    I
* 172.16.200.0/24         Self                                    I
* 200.200.200.0/24        Self                                    65100 I
* 210.210.210.0/24        Self                                    65100 I
* 220.220.220.0/24        Self                                    65100 I

[edit]
admin@SRX100B#

〇 Ciscoルータが持つ経路が広告されているかを確認

admin@SRX100B> show route protocol bgp

inet.0: 1 destinations, 1 routes (1 active, 0 holddown, 0 hidden)

VR1.inet.0: 15 destinations, 18 routes (15 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

2.2.2.2/32         *[BGP/170] 00:17:50, localpref 100
                      AS path: 65000 I
                    > to 172.16.200.254 via fe-0/0/3.0
10.1.5.0/24        *[BGP/170] 00:17:50, localpref 100
                      AS path: 65000 65001 I
                    > to 172.16.200.254 via fe-0/0/3.0
10.1.6.0/24        *[BGP/170] 00:17:50, localpref 100
                      AS path: 65000 65001 I
                    > to 172.16.200.254 via fe-0/0/3.0
200.200.200.0/24    [BGP/170] 00:17:54, MED 0, localpref 100, from 200.200.200.1
                      AS path: ?
                    > to 172.16.210.1 via fe-0/0/5.0
210.210.210.0/24    [BGP/170] 00:17:54, MED 0, localpref 100, from 200.200.200.1
                      AS path: I
                    > to 172.16.210.1 via fe-0/0/5.0
220.220.220.0/24    [BGP/170] 00:17:54, MED 0, localpref 100, from 200.200.200.1
                      AS path: ?
                    > to 172.16.210.1 via fe-0/0/5.0

VR2.inet.0: 15 destinations, 16 routes (15 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

1.1.1.1/32          [BGP/170] 00:17:50, localpref 100
                      AS path: 65100 I
                    > to 172.16.200.1 via fe-0/0/0.0
10.1.5.0/24        *[BGP/170] 00:17:54, localpref 100, from 50.5.1.1
                      AS path: 65001 I
                    > to 172.16.5.254 via fe-0/0/1.0
10.1.6.0/24        *[BGP/170] 00:17:50, localpref 100, from 50.6.1.1
                      AS path: 65001 I
                    > to 172.16.6.254 via fe-0/0/2.0
200.200.200.0/24   *[BGP/170] 00:17:50, localpref 100
                      AS path: 65100 I
                    > to 172.16.200.1 via fe-0/0/0.0
210.210.210.0/24   *[BGP/170] 00:17:50, localpref 100
                      AS path: 65100 I
                    > to 172.16.200.1 via fe-0/0/0.0
220.220.220.0/24   *[BGP/170] 00:17:50, localpref 100
                      AS path: 65100 I
                    > to 172.16.200.1 via fe-0/0/0.0

admin@SRX100B>

〇 Ciscoルータが持つ経路(200.200.200.0/24)を確認

admin@SRX100H2> show route 200.200.200.0/24

【POD6:VR1】
VR1.inet.0: 19 destinations, 26 routes (19 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

200.200.200.0/24   *[BGP/170] 01:24:04, localpref 100, from 2.2.2.2
                      AS path: 65000 65100 I
                    > to 172.16.6.1 via fe-0/0/4.0
                    [BGP/170] 01:24:04, localpref 100, from 50.5.1.1
                      AS path: 65000 65100 I
                    > to 172.16.6.1 via fe-0/0/4.0

【POD5:VR2】
VR2.inet.0: 19 destinations, 26 routes (19 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

200.200.200.0/24   *[BGP/170] 01:24:04, localpref 100, from 2.2.2.2
                      AS path: 65000 65100 I
                    > to 172.16.5.1 via fe-0/0/0.0
                    [BGP/170] 01:24:04, localpref 100, from 50.6.1.1
                      AS path: 65000 65100 I
                      to 172.30.3.6 via fe-0/0/1.0
                    > to 172.30.30.6 via fe-0/0/2.0

 

 

Local_Preferrence値の変更が有効になっていることが確認できました!(;^_^A