search
尋找貓咪~QQ 地點 桃園市桃園區 Taoyuan , Taoyuan

Juniper Junos固定arp、ndp – KerKer 的模組世界

邊做邊學,順便留個筆記,若有錯誤請不吝指教。

Junos基本操作及root密碼設定可參考我之前的文章:Juniper Junos基本操作、root密碼設定

所有Juniper相關文章列表:Juniper JunOS 系列文章列表

arp表(ipv4)、ndp表(ipv6)是用來做IP-MAC資訊對應的,讓第二層的交換得以順暢,為了避免IP遭到假冒,我們可以在Gateway端設定固定arp,讓特定IP對應到特定的mac地址。

通常在作為Gateway的介面或點對點介面我們可以看到該網段的arp表,通過show arp指令可以做到這一點,這邊我們用之前做的點對點IP來做測試,我們可以看到對端的IP-MAC對應資訊。

    [email protected]> show arp interface ge-0/0/23.0  
    MAC Address       Address         Name                      Interface               Flags
    64:c3:d6:66:8b:f3 10.0.0.1        10.0.0.1                  ge-0/0/23.0             none

如果我要鎖定這個arp表,而不讓其他將IP設定成10.0.0.1的設備影響,那我們就可以在設定模式下使用下列指令來鎖定:

    set interfaces ge-0/0/23 unit 0 family inet address 10.0.0.2/30 arp 10.0.0.1 mac 64:c3:d6:66:8b:f3

設定完成記得要commit才會生效,更多關於commit指令的內容可以參考:Juniper Junos提交設定(commit)

使用show configuration interface ge-0/0/23來查看設定檔大概長這樣:

    [email protected]> show configuration interfaces ge-0/0/23 
    description 10.0.0.1/30;
    unit 0 {
        family inet {
            address 10.0.0.2/30 {
                arp 10.0.0.1 mac 64:c3:d6:66:8b:f3;
            }
        }
    }

而ndp表的設定方式也差不多,設定格式如下:查看設定檔大概長這樣:

    set interfaces [interface] unit 0 family inet6 address [ipv6] ndp [ipv6] mac [mac]


熱門推薦

本文由 KerKerwebsite 提供 原文連結

寵物協尋 相信 終究能找到回家的路
寫了7763篇文章,獲得2次喜歡
留言回覆
回覆
精彩推薦