<p class="wp-block-paragraph">éåéå¸ï¼é 便çåçè¨ï¼è¥æé¯èª¤è«ä¸åææã </p>



<p class="wp-block-paragraph"> Junosåºæ¬æä½årootå¯ç¢¼è¨å®å¯åèæä¹åçæç« ï¼<a href="https://kerker.website/juniper-junos%E5%9F%BA%E6%9C%AC%E6%93%8D%E4%BD%9C%E3%80%81root%E5%AF%86%E7%A2%BC%E8%A8%AD%E5%AE%9A/">Juniper Junosåºæ¬æä½ãrootå¯ç¢¼è¨å®</a></p>



<p class="wp-block-paragraph">ææJuniperç¸éæç« å表ï¼<a href="https://kerker.website/juniper-junos-%E7%B3%BB%E5%88%97-%E6%96%87%E7%AB%A0%E5%88%97%E8%A1%A8/">Juniper JunOS ç³»åæç« å表</a> </p>



<!--more-->



<p class="wp-block-paragraph">çºäºè¿½æ±æ´é«çå¯ç¨æ§ï¼åæ´æ©å¶ä¹ç¸å°è¶ä¾è¶éè¦ï¼èæ¬è·¯ç±åé¤åå®(VRRP)ææçæä¾äºç¬¬ä¸è·³çåæ´æ©å¶ï¼é¿å ä½çºéé(Gateway)çè¨åæ éé æç¶²è·¯æå䏿·ã</p>



<p class="wp-block-paragraph">ç±æ¼VRRPæ¯æ¨æºåå®ï¼æä»¥å¯ä»¥å¨ä¸åå» ççè¨åä¹é建ç«VRRPçåæ´æ©å¶ï¼ä»¥ä¸ä½¿ç¨ä¸åç°¡å®çVRRPåæ´æ¶æ§ä¾èªªæJuniper交æå¨è¨åVRRPçè¨å®æ¹å¼ã</p>



<p class="wp-block-paragraph">é¦å æåå¨å ©å°L3交æå¨ä¸å»ºç«å樣çvlanï¼é裡æå使ç¨vlan 100ï¼ä¸¦çºè©²vlan æå®L3 ä»é¢(interface)ï¼vlanç¸éçè¨å®èªªæå¯ä»¥åè <strong><a href="https://kerker.website/juniper-junos%E5%9F%BA%E6%9C%ACvlan%E8%A8%AD%E5%AE%9A/">Juniper Junosåºæ¬vlanè¨å®</a></strong> ï¼</p>



<pre class="wp-block-code"><code> KerKer@sw1# set vlans v100 vlan-id 100
 KerKer@sw1# set vlans v100 l3-interface irb.100

 KerKer@sw2# set vlans v100 vlan-id 100
 KerKer@sw2# set vlans v100 l3-interface irb.100</code></pre>



<p class="wp-block-paragraph">éè¦ç¹å¥æ³¨æçæ¯éå ©å°switchçvlan 100è¦æ¥å¨åä¸åååç¶²è·¯æ¶æ§ä¸(LAN)ï¼æ¯è¼ç°¡å®çæ¹å¼æ¯ç´æ¥åå¥è¨å®ä¸å實é«ä»é¢access vlan 100ä¹å¾å°æ¥å³å¯ï¼</p>



<pre class="wp-block-code"><code> KerKer@sw1# set interfaces ge-0/0/0 unit 0 family ethernet-switching interface-mode access
 KerKer@sw1# set interfaces ge-0/0/0 unit 0 family ethernet-switching vlan members 100

 KerKer@sw2# set interfaces ge-0/0/0 unit 0 family ethernet-switching interface-mode access
 KerKer@sw2# set interfaces ge-0/0/0 unit 0 family ethernet-switching vlan members 100</code></pre>



<p class="wp-block-paragraph">æ¥ä¸ä¾æåè¦å¨éå ©åL3ä»é¢ä¸åå¥çµ¦å®ä¸åIPï¼ä¸¦å å ¥åä¸åvrrp-groupï¼ä¸æå®åä¸åvirtual-addressä¾ä½çºvlan 100çééï¼</p>



<pre class="wp-block-code"><code> KerKer@sw1# set interfaces irb unit 100 family inet address 192.168.100.252/24 vrrp-group 1 virtual-address 192.168.100.254

 KerKer@sw2# set interfaces irb unit 100 family inet address 192.168.100.253/24 vrrp-group 1 virtual-address 192.168.100.254</code></pre>



<p class="wp-block-paragraph">é常ä¾èªªæåææå給å®priorityï¼ä¸¦è¨å®æpreemptä¾ä¿è主è¦çééååæ´ééçè§è²ï¼é裡æåè®sw1ä½çºæåç主è¦ééï¼</p>



<pre class="wp-block-code"><code> KerKer@sw1# set interfaces irb unit 100 family inet address 192.168.100.252/24 vrrp-group 1 priority 254
 KerKer@sw1# set interfaces irb unit 100 family inet address 192.168.100.252/24 vrrp-group 1 preempt

 KerKer@sw2# set interfaces irb unit 100 family inet address 192.168.100.253/24 vrrp-group 1 priority 253
 KerKer@sw2# set interfaces irb unit 100 family inet address 192.168.100.253/24 vrrp-group 1 preempt</code></pre>



<p class="wp-block-paragraph">å¦å¤VRRPçvirtual-addressé è¨æ¯ä¸æ¥åä»»ä½é¤äºarp以å¤çå°å ï¼çºäºæ¹ä¾¿ééicmp ping測試æ¯å¦ææ£ç¢ºé£éï¼å¯ä»¥è¨å®accept-dataä¾å 許arp以å¤çå°å ï¼</p>



<pre class="wp-block-code"><code> KerKer@sw1# set interfaces irb unit 100 family inet address 192.168.100.252/24 vrrp-group 1 accept-data

 KerKer@sw2# set interfaces irb unit 100 family inet address 192.168.100.253/24 vrrp-group 1 accept-data</code></pre>



<p class="wp-block-paragraph">鿍£ä¸ä¾åªè¦å°å¨vlan 100çè¨åé½è¨å®æä»¥ virtual-address ä½çºéé(Gateway)ï¼å°±å¯ä»¥ææçé¿å å®å°è¨åæ éé æç¬¬ä¸è·³å¤±æçåé¡äºã</p>

[Juniper] Junos虛擬路由冗餘協定(VRRP)備援架構

