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

Juniper Junos介面IP設定 – KerKer 的模組世界

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

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

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

要在Juniper的介面上設定IP,需要在介面上設定family為inet。

如果你要設定的介面上已經有一個family ethernet-switching的設定請把它刪掉,因為一個介面不能同時具備Routing介面及Switching介面的特性:

    [email protected]# delete interfaces ge-0/0/23 unit 0 family ethernet-switching

進入設定模式後使用下列指進入要設定IP的介面下進行編輯:

    [email protected]# edit interfaces ge-0/0/23 unit 0 

接著使用set address指令進行IP設定:

    {master:0}[edit interfaces ge-0/0/23 unit 0]
    [email protected]# set family inet address 10.0.0.2/30

Juniper在IP設定的遮罩部分是直接使用/來標示,如上方之設定即為IP:10.0.0.2 遮罩:255.255.255.252。

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

回到命令模式我們可以用指令查看該介面狀態:

    [email protected]> show interfaces terse ge-0/0/23          
    Interface               Admin Link Proto    Local                 Remote
    ge-0/0/23               up    down
    ge-0/0/23.0             up    down inet     10.0.0.2/30 

我們可以看到已經成功在介面上設定IP了,不過介面的Link仍然是down的狀態,這裡我在另外一台Switch上做了10.0.0.1的IP,並用網路線將它們串起。再次查看介面狀態可以看到Link已經轉換成up了。

    [email protected]> show interfaces terse ge-0/0/23 
    Interface               Admin Link Proto    Local                 Remote
    ge-0/0/23               up    up
    ge-0/0/23.0             up    up   inet     10.0.0.2/30 

這時候可以嘗試去ping對端的IP確認IP設定無誤。

    [email protected]> ping 10.0.0.1    
    PING 10.0.0.1 (10.0.0.1): 56 data bytes
    64 bytes from 10.0.0.1: icmp_seq=0 ttl=64 time=22.719 ms
    64 bytes from 10.0.0.1: icmp_seq=1 ttl=64 time=16.587 ms
    64 bytes from 10.0.0.1: icmp_seq=2 ttl=64 time=24.632 ms
    64 bytes from 10.0.0.1: icmp_seq=3 ttl=64 time=21.865 ms


熱門推薦

本文由 KerKerwebsite 提供 原文連結

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