PE客戶路由實例里auto-export的使用

cust-A-1與cust-B-1的lo0地址要互通

root@PE> show configuration | display set

set version 14.1R4.8

set system host-name PE

set system root-authentication encrypted-password "$1$65QU7nZx$/CELLqn/JjiG1yYaOD/c3/"

set system syslog user * any emergency

set system syslog file messages any notice

set system syslog file messages authorization info

set system syslog file interactive-commands interactive-commands any

set interfaces ge-0/0/0 unit 0 family inet address 192.168.1.2/30

set interfaces ge-0/0/1 unit 0 family inet address 192.168.2.2/30

set interfaces lo0 unit 0 family inet address 10.0.255.3/32

set routing-options router-id 10.0.255.3

set routing-options autonomous-system 65003

set policy-options policy-statement import-from-cust-A term 1 from community cust-A

set policy-options policy-statement import-from-cust-A term 1 then accept

set policy-options policy-statement import-from-cust-B term 1 from community cust-B

set policy-options policy-statement import-from-cust-B term 1 then accept

set policy-options community cust-A members target:65003:1

set policy-options community cust-B members target:65003:2

set routing-instances cust-A instance-type vrf

set routing-instances cust-A interface ge-0/0/0.0

set routing-instances cust-A route-distinguisher 65003:1

set routing-instances cust-A vrf-import import-from-cust-B

set routing-instances cust-A vrf-target target:65003:1

set routing-instances cust-A routing-options auto-export

set routing-instances cust-A protocols bgp group PE-CE type external

set routing-instances cust-A protocols bgp group PE-CE neighbor 192.168.1.1 peer-as 65001

set routing-instances cust-B instance-type vrf

set routing-instances cust-B interface ge-0/0/1.0

set routing-instances cust-B route-distinguisher 65003:2

set routing-instances cust-B vrf-import import-from-cust-A

set routing-instances cust-B vrf-target target:65003:2

set routing-instances cust-B routing-options auto-export

set routing-instances cust-B protocols bgp group PE-CE type external

set routing-instances cust-B protocols bgp group PE-CE neighbor 192.168.2.1 peer-as 65002

root@cust-A# run show configuration | display set

set version 14.1R4.8

set system host-name cust-A

set system root-authentication encrypted-password "$1$EQZTCpt8$v6k.Awtmq53g76ezR1VKd."

set system syslog user * any emergency

set system syslog file messages any notice

set system syslog file messages authorization info

set system syslog file interactive-commands interactive-commands any

set interfaces ge-0/0/0 unit 0 family inet address 192.168.1.1/30

set interfaces lo0 unit 0 family inet address 10.0.255.1/32

set routing-options router-id 10.0.255.1

set routing-options autonomous-system 65001

set protocols bgp group EBGP type external

set protocols bgp group EBGP export export-lo0

set protocols bgp group EBGP neighbor 192.168.1.2 peer-as 65003

set policy-options policy-statement export-lo0 term 1 from interface lo0.0

set policy-options policy-statement export-lo0 term 1 then accept


root@cust-B# run show configuration | display set

set version 14.1R4.8

set system root-authentication encrypted-password "$1$r/RbmCuW$eWwmuUqbY6CE5OcvADzap0"

set system syslog user * any emergency

set system syslog file messages any notice

set system syslog file messages authorization info

set system syslog file interactive-commands interactive-commands any

set interfaces ge-0/0/1 unit 0 family inet address 192.168.2.1/30

set interfaces lo0 unit 0 family inet address 10.0.255.2/32

set routing-options router-id 10.0.255.2

set routing-options autonomous-system 65002

set protocols bgp group EBGP type external

set protocols bgp group EBGP export export-lo0

set protocols bgp group EBGP neighbor 192.168.2.2 peer-as 65003

set policy-options policy-statement export-lo0 term 1 from interface lo0.0

set policy-options policy-statement export-lo0 term 1 then accept


驗證:

root@cust-A> show route

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

+ = Active Route, - = Last Active, * = Both

10.0.255.1/32? ? ? *[Direct/0] 00:27:35

? ? ? ? ? ? ? ? ? ? > via lo0.0

10.0.255.2/32? ? ? *[BGP/170] 00:05:25, localpref 100

? ? ? ? ? ? ? ? ? ? ? AS path: 65003 65002 I, validation-state: unverified

? ? ? ? ? ? ? ? ? ? > to 192.168.1.2 via ge-0/0/0.0

192.168.1.0/30? ? *[Direct/0] 00:27:35

? ? ? ? ? ? ? ? ? ? > via ge-0/0/0.0

192.168.1.1/32? ? *[Local/0] 00:27:35

? ? ? ? ? ? ? ? ? ? ? Local via ge-0/0/0.0

root@cust-B> show route

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

+ = Active Route, - = Last Active, * = Both

10.0.255.1/32? ? ? *[BGP/170] 00:09:49, localpref 100

? ? ? ? ? ? ? ? ? ? ? AS path: 65003 65001 I, validation-state: unverified

? ? ? ? ? ? ? ? ? ? > to 192.168.2.2 via ge-0/0/1.0

10.0.255.2/32? ? ? *[Direct/0] 00:27:34

? ? ? ? ? ? ? ? ? ? > via lo0.0

192.168.2.0/30? ? *[Direct/0] 00:27:34

? ? ? ? ? ? ? ? ? ? > via ge-0/0/1.0

192.168.2.1/32? ? *[Local/0] 00:27:34

? ? ? ? ? ? ? ? ? ? ? Local via ge-0/0/1.0

root@cust-B> ping source 10.0.255.2 10.0.255.1 rapid count 6

PING 10.0.255.1 (10.0.255.1): 56 data bytes

!!!!!!

--- 10.0.255.1 ping statistics ---

6 packets transmitted, 6 packets received, 0% packet loss

round-trip min/avg/max/stddev = 3.340/4.229/6.315/1.034 ms

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末,一起剝皮案震驚了整個濱河市古涧,隨后出現(xiàn)的幾起案子西采,更是在濱河造成了極大的恐慌点弯,老刑警劉巖霜第,帶你破解...
    沈念sama閱讀 218,640評論 6 507
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件凡桥,死亡現(xiàn)場離奇詭異,居然都是意外死亡喷好,警方通過查閱死者的電腦和手機翔横,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 93,254評論 3 395
  • 文/潘曉璐 我一進店門,熙熙樓的掌柜王于貴愁眉苦臉地迎上來梗搅,“玉大人禾唁,你說我怎么就攤上這事∥耷校” “怎么了荡短?”我有些...
    開封第一講書人閱讀 165,011評論 0 355
  • 文/不壞的土叔 我叫張陵,是天一觀的道長哆键。 經(jīng)常有香客問我掘托,道長,這世上最難降的妖魔是什么籍嘹? 我笑而不...
    開封第一講書人閱讀 58,755評論 1 294
  • 正文 為了忘掉前任闪盔,我火速辦了婚禮,結(jié)果婚禮上辱士,老公的妹妹穿的比我還像新娘泪掀。我一直安慰自己,他們只是感情好颂碘,可當我...
    茶點故事閱讀 67,774評論 6 392
  • 文/花漫 我一把揭開白布异赫。 她就那樣靜靜地躺著,像睡著了一般头岔。 火紅的嫁衣襯著肌膚如雪塔拳。 梳的紋絲不亂的頭發(fā)上,一...
    開封第一講書人閱讀 51,610評論 1 305
  • 那天切油,我揣著相機與錄音蝙斜,去河邊找鬼。 笑死澎胡,一個胖子當著我的面吹牛孕荠,可吹牛的內(nèi)容都是我干的。 我是一名探鬼主播攻谁,決...
    沈念sama閱讀 40,352評論 3 418
  • 文/蒼蘭香墨 我猛地睜開眼稚伍,長吁一口氣:“原來是場噩夢啊……” “哼!你這毒婦竟也來了戚宦?” 一聲冷哼從身側(cè)響起个曙,我...
    開封第一講書人閱讀 39,257評論 0 276
  • 序言:老撾萬榮一對情侶失蹤,失蹤者是張志新(化名)和其女友劉穎,沒想到半個月后垦搬,有當?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體呼寸,經(jīng)...
    沈念sama閱讀 45,717評論 1 315
  • 正文 獨居荒郊野嶺守林人離奇死亡,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點故事閱讀 37,894評論 3 336
  • 正文 我和宋清朗相戀三年猴贰,在試婚紗的時候發(fā)現(xiàn)自己被綠了对雪。 大學時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片。...
    茶點故事閱讀 40,021評論 1 350
  • 序言:一個原本活蹦亂跳的男人離奇死亡米绕,死狀恐怖瑟捣,靈堂內(nèi)的尸體忽然破棺而出,到底是詐尸還是另有隱情栅干,我是刑警寧澤迈套,帶...
    沈念sama閱讀 35,735評論 5 346
  • 正文 年R本政府宣布,位于F島的核電站碱鳞,受9級特大地震影響桑李,放射性物質(zhì)發(fā)生泄漏。R本人自食惡果不足惜劫笙,卻給世界環(huán)境...
    茶點故事閱讀 41,354評論 3 330
  • 文/蒙蒙 一芙扎、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧填大,春花似錦、人聲如沸俏橘。這莊子的主人今日做“春日...
    開封第一講書人閱讀 31,936評論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽寥掐。三九已至靴寂,卻和暖如春,著一層夾襖步出監(jiān)牢的瞬間召耘,已是汗流浹背百炬。 一陣腳步聲響...
    開封第一講書人閱讀 33,054評論 1 270
  • 我被黑心中介騙來泰國打工, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留污它,地道東北人剖踊。 一個月前我還...
    沈念sama閱讀 48,224評論 3 371
  • 正文 我出身青樓,卻偏偏與公主長得像衫贬,于是被迫代替她去往敵國和親德澈。 傳聞我的和親對象是個殘疾皇子,可洞房花燭夜當晚...
    茶點故事閱讀 44,974評論 2 355

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