JUNOS - interface



 ◆ JUNOS - インターフェースのネーミング

 SRXのFastEthernet0/0/0ポートに「192.168.0.254」のIPアドレスを設定する設定例は以下です。

 root@SRX100# set interfaces fe-0/0/0 unit 0 family inet address 192.168.0.254/24


 ◆ 「 fe-0/0/0 」 とは
 例えばSRX100ではオンボードでFastEthernetが8ポートがあるだけであり、FPCやPICに該当するものは1つしかないことから
 SRX100の物理インターフェースは、fe-0/0/0、fe-0/0/1、fe-0/0/2、fe-0/0/3 などのように必ず fe-0/0/x ではじまります。


  



 
◆ 「 unit 0 」 とは
 unit 0 とは物理インターフェース内で設定した論理ユニットです。トラフィックを伝送できるようにするためにあらかじめ
 各物理インターフェースに1つ以上の論理インターフェースを設定する必要があります。論理I/Fは 0 から順に番号を付けます。
 要は、JUNOSでは物理I/Fに直接IPアドレスを割り振るのではなく「論理I/FにIPアドレスを割り振る必要がある」ということ。


 
◆ 「 family inet 」 とは
 論理インターフェースで使用するプロトコルを示します。各論理インターフェースに1つ以上のプロトコルを設定する必要があり、
 IPv4アドレスを使用する場合は「family inet」と設定し、IPv6アドレスを使用するの場合は「family inet6」と設定します。
 SRXなどのルータのインターフェースをスイッチポートとして使用したい場合は「family ethernet-switching と設定します。
 SRXをL2トランスペアレントモードとして動作させたい場合、該当ポートでfamily bridgeと設定。JUNOS11.1 からサポート。


 ◆ JUNOS - インターフェースの見方

 JUNOSを搭載した機器で使用できるインターフェースは
show interface terseコマンドで確認できます。
 以下のshow interface terseの出力は、SRX100のデフォルトのインターフェースの状態を示しています。
 show interface terseでは、そのSRXで使用できる物理I/Fと論理I/Fの全てを出力しています。

 


 
【主な物理インターフェース】
メディアタイプ 説明
fe  FastEthernet interface
ge  GigabitEthernet interface
xe  10-GigabitEthernet interface
ae  Aggregated Ethernet interface
at  ATM-over-ADSL or ATM-over-SHDSL WAN interface
bc  Bearer channel on an ISDN interface
br  Basic Rate Interface for establishing ISDN connections
ce1  Channelized E1 interface
ct1  Channelized T1 interface
dc  Delta channel on an ISDN interface
dl  Dialer interface for initiating ISDN and USB modem connections
e1  E1 WAN interface
e3  E3 WAN interface
se  Serial interface (either RS-232, RS-422/499, RS-530, V.35, or X.21)
t1  T1 (also called DS1) WAN interface
t3  T3 (also called DS3) WAN interface
wx  WXC Integrated Services Module (ISM 200) interface for WAN acceleration



 【 主な論理インターフェース 】
メディアタイプ 説明
fab  The data plane interface
fxp  Management and internal Ethernet interfaces for J Series, M Series, and MX Series routers
fxp0  The out-of-band management interface
fxp1  The control plane interface
dsc  Discard interface
gr  Generic routing encapsulation (GRE) tunnel interface
gre  Internally generated interface that is configurable only as the control channel for Generalized MPLS
ip  IP-over-IP encapsulation tunnel interface
ipip  Internally generated interface that is not configurable
lo  Loopback interface
lt  Logical Tunnel interface
lsi  Internally generated interface that is not configurable
mtun  Internally generated interface that is not configurable
pp  pppoe interface
pd  Interface on the rendezvous point (RP) that de-encapsulates packets
pe  Interface on the first-hop RP that encapsulates packets destined for the RP router
pimd  Internally generated interface that is not configurable
pime  Internally generated interface that is not configurable
reth  For chassis cluster configurations only, redundant Ethernet interface
st  Route-Based VPN Tunnels Interface
tap  Internally generated interface that is not configurable
vlan  Vlan interface


 ◆ JUNOS - インターフェースの設定方法

 
◆ IPアドレスの割り当て
 
◆ 設定例 : FastEthernet0/0/0 に「192.168.0.254/24」のIPアドレスの割り当て
 root@SRX100# set interfaces fe-0/0/0 unit 0 family inet address 192.168.0.254/24



 ◆ 複数のIPアドレスの割り当て
 ⇒ 既存設定に加えて、追加で set interface でIPアドレスを設定すると上書きせずに追加される。
 
◆ 設定例 : FastEthernet0/0/0 に「192.168.0.254/24」と「172.16.0.254/24」2つのIPアドレスの割り当て

 root@SRX100#
set interfaces fe-0/0/0 unit 0 family inet address 192.168.0.254/24
 root@SRX100# set interfaces fe-0/0/0 unit 0 family inet address 172.16.0.254/24



 ◆ IPアドレスの設定変更
 
◆ 設定例 : FastEthernet0/0/0 に割り当てられた「10.1.1.1」を「10.2.2.2」に変更
 root@SRX100# rename interfaces fe-0/0/0 unit 0 family inet address 10.1.1.1/24 to address 10.2.2.2/24



 
◆ IPアドレスの設定削除
 
◆ 設定例 : FastEthernet0/0/0 に割り当てられた「192.168.0.254」を削除
 root@SRX100# delete interfaces fe-0/0/0 unit 0 family inet address 192.168.0.254/24



 ◆ 一時的なインターフェースの非有効化
 
◆ 設定例 : 一時的にFastEthernet0/0/0 を Inactive(非有効化)にする
 root@SRX100# deactivate interfaces fe-0/0/0



 ◆ 非有効化にしたインターフェースの有効化
 
◆ 設定例 : Inactive にしたFastEthernet0/0/0 を activate(有効化)にする
 root@SRX100# activate interfaces fe-0/0/0



 ◆ ループバックインターフェースの設定
 
◆ 設定例 : ループバックインターフェース(lo0)に「192.168.5.5/32」を設定する。「/32」で割り当てる必要がある。
 root@SRX100# set interfaces lo0 unit 0 family inet address 192.168.5.5/32


 ◆ JUNOS - Ethernetインターフェースの設定方法

 
◆ speed/duplexの設定
 
⇒ SRX100のFastEthernetポートの speed/duplexはデフォルトで auto/auto 状態。
 
◆ 設定例 : FastEthernet0/0/0 インターフェースの speed =100Mbps、duplex = full の固定設定にする

 root@SRX100#
set interfaces fe-0/0/0 speed 100m
 root@SRX100# set interfaces fe-0/0/0 link-mode full-duplex



 ◆ MACアドレスのフィルタリング
 
⇒ 特定の送信元MACアドレスからの通信のみを許可し、それ以外の通信を破棄する設定
 
◆ 設定例 : FastEthernet0/0/0 インターフェースに着信する 00:00:00:11:22:33 の送信元MACアドレスのみ許可する

 root@test#
set interfaces fe-0/0/0 fastether-options source-filtering
 root@test# set interfaces fe-0/0/0 fastether-options source-address-filter 00:00:00:11:22:33


 
SRX100で実装すると Warning: statement ignored: unsupported platform (srx100b) と出力されますが実際には動作します。




 ◆ VLANタギングの設定
 
⇒ 1つの物理インターフェース上で複数のVLANトラフィックを伝送できる
 
◆ 設定例 : FastEthernet0/0/0 上でVLAN10(192.168.10.0/24)、VLAN20(192.168.20.0/24)のトラフィックを伝送

 root@SRX100#
set interfaces fe-0/0/0 vlan-tagging
 root@SRX100# set interfaces fe-0/0/0 unit 0 vlan-id 10
 root@SRX100# set interfaces fe-0/0/0 unit 0 family inet address 192.168.10.254/24
 root@SRX100# set interfaces fe-0/0/0 unit 1 vlan-id 20
 root@SRX100# set interfaces fe-0/0/0 unit 1 family inet address 192.168.20.254/24


 SRXの場合、作成した論理I/Fにセキュリティゾーンが割り当てられているか show interface fe-0/0/0.1 などで確認しましょう



 ◆ JUNOS - ルーティングの基本設定

 
◆ スタティックルートの設定
 
◆ 設定例 : 10.1.1.0/24 の宛先ネットワークへのネクストホップを 172.16.0.254 とする設定
 root@SRX100# set routing-options static route 10.1.1.0/24 next-hop 172.16.0.254


 ◆ デフォルトルートの設定
 
◆ 設定例 : デフォルトルートのネクストホップを 172.16.1.254 とする設定
 root@SRX100# set routing-options static route 0.0.0.0/0 next-hop 172.16.1.254



Juniper - JUNOS 設定コマンド解説

Copyright(C) 2002-2024 ネットワークエンジニアとして All Rights Reserved