Juniper vMX 實現(xiàn)EVPN

實驗topo


EVPN-TOPO.png

說明:

版本:
juniper@vMX-1# run show version 
Hostname: vMX-1
Model: vmx
Junos: 14.1R1.10
......

vMX網(wǎng)卡對應(yīng)關(guān)系
網(wǎng)卡1     RE
網(wǎng)卡2     RE
網(wǎng)卡3     ge-0/0/0
網(wǎng)卡4     ge-0/0/1
.
.
.
網(wǎng)卡10    ge-0/0/7

logical-system不支持EVPN(也就是只能在全局路由器下的routing-instance 才能用EVPN)列荔,所以這里跑了兩臺vMX,兩臺的ge-0/0/3橋接在一起(也就是兩臺vmx的第6塊網(wǎng)卡橋接到一個VMnet上)。分別把兩臺的ge-0/0/1.100放入evpn instance 里面(全局路由器ge-0/0/1使用vlan-tagging)枚尼,在這之前需要把各自vMX的ge-0/0/1和ge-0/0/2橋接在一起(把vMX1的ge-0/0/1和ge-0/0/2橋接在VMnetA贴浙,vMX2的ge-0/0/1和ge-0/0/2橋接在VMnetB)。兩臺vMX分別分出一個logical-system署恍,放入接口ge-0/0/1.100來模擬用戶崎溃。

vMX1的配置

logical-systems {
    r1 {
        interfaces {
            ge-0/0/2 {
                unit 100 {
                    vlan-id 100;
                    family inet {
                        address 192.168.14.1/24;
                    }
                }
            }
        }
  }
interfaces {
    ge-0/0/1 {
        flexible-vlan-tagging;
        encapsulation flexible-ethernet-services;
        unit 100 {
            encapsulation vlan-bridge;
            vlan-id 100;
        }
    }
    ge-0/0/2 {
        vlan-tagging;
    }
    ge-0/0/3 {
        unit 0 {
            family inet {
                address 192.168.23.2/24;
            }
            family mpls;
        }
    }
    ge-0/0/7 {
        unit 0 {
            family inet {
                address 172.16.33.100/24;
            }
        }
    }
    lo0 {
        unit 0 {
            family inet {
                address 2.2.2.2/32;
            }
        }
    }
}
routing-options {
    autonomous-system 65000;
}
protocols {
    mpls {
        interface ge-0/0/3.0;
    }
    bgp {
        group internal {
            type internal;
            local-address 2.2.2.2;
            family inet-vpn {
                unicast;
            }
            family evpn {
                signaling;
            }
            neighbor 3.3.3.3;
        }
    }
    ospf {
        area 0.0.0.0 {
            interface lo0.0 {
                passive;
            }
            interface ge-0/0/3.0;
        }
    }
    ldp {
        interface ge-0/0/3.0;
    }
}
routing-instances {
    EVPN100 {
        instance-type evpn;
        vlan-id 100;
        interface ge-0/0/1.100;
        route-distinguisher 2.2.2.2:1;
        vrf-target target:1:1;
        protocols {
            evpn;
        }
    }
}

vMX2的配置

logical-systems {
    r4 {
        interfaces {
            ge-0/0/2 {
                unit 100 {
                    vlan-id 100;
                    family inet {
                        address 192.168.14.4/24;
                    }
                }
            }
        }
    }
interfaces {
    ge-0/0/1 {
        flexible-vlan-tagging;
        encapsulation flexible-ethernet-services;
        unit 100 {
            encapsulation vlan-bridge;
            vlan-id 100;
        }
    }
    ge-0/0/2 {
        vlan-tagging;
    }
    ge-0/0/3 {
        unit 0 {
            family inet {
                address 192.168.23.3/24;
            }
            family mpls;
        }
    }
    ge-0/0/7 {
        unit 0 {
            family inet {
                address 172.16.33.200/24;
            }
        }
    }
    lo0 {
        unit 0 {
            family inet {
                address 3.3.3.3/32;
            }
        }
    }
}
routing-options {
    autonomous-system 65000;
}
protocols {
    mpls {
        interface ge-0/0/3.0;
    }
    bgp {
        group internal {
            type internal;
            local-address 3.3.3.3;
            family inet-vpn {
                unicast;
            }
            family evpn {
                signaling;
            }
            neighbor 2.2.2.2;
        }
    }
    ospf {
        area 0.0.0.0 {
            interface lo0.0 {
                passive;
            }
            interface ge-0/0/3.0;
        }
    }
    ldp {
        interface ge-0/0/3.0;
    }
}
routing-instances {
    EVPN100 {
        instance-type evpn;
        vlan-id 100;
        interface ge-0/0/1.100;
        route-distinguisher 2.2.2.2:1;
        vrf-target target:1:1;
        protocols {
            evpn;
        }
    }
}

查看路由表vMX1

juniper@vMX-1> show route table EVPN100.evpn.0 

EVPN100.evpn.0: 4 destinations, 4 routes (4 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

2:2.2.2.2:1::100::00:05:86:71:05:02/304               
                   *[EVPN/170] 00:06:45
                      Indirect
2:2.2.2.2:1::100::00:05:86:71:b2:02/304               
                   *[BGP/170] 00:05:27, localpref 100, from 3.3.3.3
                      AS path: I, validation-state: unverified
                    > to 192.168.23.3 via ge-0/0/3.0
3:2.2.2.2:1::100::2.2.2.2/304               
                   *[EVPN/170] 00:06:53
                      Indirect
3:2.2.2.2:1::100::3.3.3.3/304               
                   *[BGP/170] 00:05:27, localpref 100, from 3.3.3.3
                      AS path: I, validation-state: unverified
                    > to 192.168.23.3 via ge-0/0/3.0
##########
juniper@vMX-1> show route table bgp.evpn.0 

bgp.evpn.0: 2 destinations, 2 routes (2 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

2:2.2.2.2:1::100::00:05:86:71:b2:02/304               
                   *[BGP/170] 00:06:59, localpref 100, from 3.3.3.3
                      AS path: I, validation-state: unverified
                    > to 192.168.23.3 via ge-0/0/3.0
3:2.2.2.2:1::100::3.3.3.3/304               
                   *[BGP/170] 00:06:59, localpref 100, from 3.3.3.3
                      AS path: I, validation-state: unverified
                    > to 192.168.23.3 via ge-0/0/3.0

在vrf EVPN100中junos會默認導(dǎo)入兩條策略

juniper@vMX-1> show route instance EVPN100 extensive 
EVPN100:
  Router ID: 0.0.0.0
                          State: Active        
  Interfaces:
    ge-0/0/1.100
  Route-distinguisher: 2.2.2.2:1
  Vrf-import: [ __vrf-import-EVPN100-internal__ ]
  Vrf-export: [ __vrf-export-EVPN100-internal__ ]
  Vrf-import-target: [ target:1:1 ]
  Vrf-export-target: [ target:1:1 ]
  Fast-reroute-priority: low
  Tables:
    EVPN100.evpn.0         : 0 routes (0 active, 0 holddown, 0 hidden)
    EVPN100.evpn.0         : 4 routes (4 active, 0 holddown, 0 hidden)
###########
juniper@vMX-1> show policy ?           
Possible completions:
  <[Enter]>            Execute this command
  <policy>             Name of policy
  __vrf-export-EVPN100-internal__  
  __vrf-import-EVPN100-internal__  
  conditions           Show conditions used by policy
  damping              Show state of route flap damping
  fabric               Internal fabric state
  logical-system       Name of logical system, or 'all'
  |                    Pipe through a command

############
juniper@vMX-1> show policy __vrf-export-EVPN100-internal__ 
Policy __vrf-export-EVPN100-internal__:
    Term unnamed:
        then community + __vrf-community-EVPN100-common-internal__ [target:1:1 ] accept

############
juniper@vMX-1> show policy __vrf-import-EVPN100-internal__ 
Policy __vrf-import-EVPN100-internal__:
    Term unnamed:
        from community __vrf-community-EVPN100-common-internal__ [target:1:1 ]
        then accept
    Term unnamed:
        then reject

連通性測試

juniper@vMX-1# run ping 192.168.14.4 logical-system r1 source 192.168.14.1 rapid 
PING 192.168.14.4 (192.168.14.4): 56 data bytes
!!!!!
--- 192.168.14.4 ping statistics ---
5 packets transmitted, 5 packets received, 0% packet loss
round-trip min/avg/max/stddev = 3.391/5.797/8.227/1.836 ms

###########
juniper@vMX-1# run show arp logical-system r1 no-resolve 
MAC Address       Address         Interface     Flags
00:05:86:71:b2:02 192.168.14.4    ge-0/0/2.100         none

###########
juniper@vMX-1# run show evpn instance EVPN100 extensive 
Instance: EVPN100
  Route Distinguisher: 2.2.2.2:1
  VLAN ID: 100
  Per-instance MAC route label: 299776
  Per-instance multicast route label: 299792
  MAC database status                Local  Remote
    Total MAC addresses:                 1       1
    Default gateway MAC addresses:       0       0
  Number of local interfaces: 1 (1 up)
    Interface name  ESI                            Mode             SH label
    ge-0/0/1.100    00:00:00:00:00:00:00:00:00:00  single-homed   
  Number of IRB interfaces: 0 (0 up)
  Number of neighbors: 1
    3.3.3.3
      Received routes
        MAC address advertisement:              1
        MAC+IP address advertisement:           0
        Inclusive multicast:                    1
        Ethernet auto-discovery:                0
  Number of ethernet segments: 0

vMX1的ge-0/0/3.0 接口抓包
Fution和VMware workstations上對應(yīng)的VMnet接口其實就是一個HUB,想要對ge-0/0/3.0接口的包盯质,只需要抓ge-0/0/3橋接的虛擬接口袁串。
抓包截圖如下:


EVPN-pac.png

vMX 各接口MAC地址:

juniper@vMX-1# run show interfaces ge-0/0/1 | match "Current address" 
  Current address: 00:05:86:71:05:01, Hardware address: 00:05:86:71:05:01

[edit]
juniper@vMX-1# run show interfaces ge-0/0/2 | match "Current address"    
  Current address: 00:05:86:71:05:02, Hardware address: 00:05:86:71:05:02

[edit]
juniper@vMX-1# run show interfaces ge-0/0/3 | match "Current address"    
  Current address: 00:05:86:71:05:03, Hardware address: 00:05:86:71:05:03

[edit]

vMX2各接口MAC地址:
juniper@vMX-2# run show interfaces ge-0/0/1 | match "Current address" 
  Current address: 00:05:86:71:b2:01, Hardware address: 00:05:86:71:b2:01

[edit]
juniper@vMX-2# run show interfaces ge-0/0/2 | match "Current address"    
  Current address: 00:05:86:71:b2:02, Hardware address: 00:05:86:71:b2:02

[edit]
juniper@vMX-2# run show interfaces ge-0/0/3 | match "Current address"    
  Current address: 00:05:86:71:b2:03, Hardware address: 00:05:86:71:b2:03

[edit]
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末,一起剝皮案震驚了整個濱河市呼巷,隨后出現(xiàn)的幾起案子囱修,更是在濱河造成了極大的恐慌,老刑警劉巖王悍,帶你破解...
    沈念sama閱讀 222,946評論 6 518
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件破镰,死亡現(xiàn)場離奇詭異,居然都是意外死亡,警方通過查閱死者的電腦和手機啤咽,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 95,336評論 3 399
  • 文/潘曉璐 我一進店門晋辆,熙熙樓的掌柜王于貴愁眉苦臉地迎上來,“玉大人宇整,你說我怎么就攤上這事瓶佳。” “怎么了鳞青?”我有些...
    開封第一講書人閱讀 169,716評論 0 364
  • 文/不壞的土叔 我叫張陵霸饲,是天一觀的道長。 經(jīng)常有香客問我臂拓,道長厚脉,這世上最難降的妖魔是什么? 我笑而不...
    開封第一講書人閱讀 60,222評論 1 300
  • 正文 為了忘掉前任胶惰,我火速辦了婚禮傻工,結(jié)果婚禮上,老公的妹妹穿的比我還像新娘孵滞。我一直安慰自己中捆,他們只是感情好,可當我...
    茶點故事閱讀 69,223評論 6 398
  • 文/花漫 我一把揭開白布坊饶。 她就那樣靜靜地躺著泄伪,像睡著了一般。 火紅的嫁衣襯著肌膚如雪匿级。 梳的紋絲不亂的頭發(fā)上蟋滴,一...
    開封第一講書人閱讀 52,807評論 1 314
  • 那天,我揣著相機與錄音痘绎,去河邊找鬼津函。 笑死,一個胖子當著我的面吹牛孤页,可吹牛的內(nèi)容都是我干的球散。 我是一名探鬼主播,決...
    沈念sama閱讀 41,235評論 3 424
  • 文/蒼蘭香墨 我猛地睜開眼散庶,長吁一口氣:“原來是場噩夢啊……” “哼蕉堰!你這毒婦竟也來了?” 一聲冷哼從身側(cè)響起悲龟,我...
    開封第一講書人閱讀 40,189評論 0 277
  • 序言:老撾萬榮一對情侶失蹤琅翻,失蹤者是張志新(化名)和其女友劉穎锨天,沒想到半個月后稻爬,有當?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體仰冠,經(jīng)...
    沈念sama閱讀 46,712評論 1 320
  • 正文 獨居荒郊野嶺守林人離奇死亡斩芭,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點故事閱讀 38,775評論 3 343
  • 正文 我和宋清朗相戀三年,在試婚紗的時候發(fā)現(xiàn)自己被綠了乐疆。 大學(xué)時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片划乖。...
    茶點故事閱讀 40,926評論 1 353
  • 序言:一個原本活蹦亂跳的男人離奇死亡,死狀恐怖挤土,靈堂內(nèi)的尸體忽然破棺而出琴庵,到底是詐尸還是另有隱情,我是刑警寧澤仰美,帶...
    沈念sama閱讀 36,580評論 5 351
  • 正文 年R本政府宣布迷殿,位于F島的核電站,受9級特大地震影響咖杂,放射性物質(zhì)發(fā)生泄漏庆寺。R本人自食惡果不足惜,卻給世界環(huán)境...
    茶點故事閱讀 42,259評論 3 336
  • 文/蒙蒙 一诉字、第九天 我趴在偏房一處隱蔽的房頂上張望懦尝。 院中可真熱鬧,春花似錦壤圃、人聲如沸陵霉。這莊子的主人今日做“春日...
    開封第一講書人閱讀 32,750評論 0 25
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽。三九已至鹰晨,卻和暖如春墨叛,著一層夾襖步出監(jiān)牢的瞬間,已是汗流浹背模蜡。 一陣腳步聲響...
    開封第一講書人閱讀 33,867評論 1 274
  • 我被黑心中介騙來泰國打工漠趁, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留,地道東北人忍疾。 一個月前我還...
    沈念sama閱讀 49,368評論 3 379
  • 正文 我出身青樓闯传,卻偏偏與公主長得像,于是被迫代替她去往敵國和親卤妒。 傳聞我的和親對象是個殘疾皇子甥绿,可洞房花燭夜當晚...
    茶點故事閱讀 45,930評論 2 361

推薦閱讀更多精彩內(nèi)容