0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

JuniperSwitch_EX4300_リセットからSSH接続まで

Last updated at Posted at 2023-03-17

juniperEX4300の工場出荷状態からL3インターフェイスにIPアドレス付与して、ssh接続するまでの流れを記録。

リセットからセットアップ

工場出荷時の設定をロードしてコミットします。
RescueConfigやRollbackConfigなどその他の設定ファイルは排除されない。

# load factory-default
# set system root-authentication plain-text-password
# commit

このコマンドも出荷時のデフォルト設定に戻すことが出来るが、RescueConfigやRollbackConfigなどその他の設定ファイル
およびログ情報含む、すべてのファイルを排除。

# request system zeroize

工場出荷状態からのセットアップ

# 初期パスワード
login: root
Password: なし

# CLI
root@:RE:0% cli
root>

# 管理者権限
root> configure
Entering configuration mode

[edit]
root#

# 管理者パスワード設定
# set system root-authentication plain-text-password
New password: *****
Retype password: ****

# ホスト名
# set system host-name *****

# タイムゾーン
# set system time-zone Asia/Tokyo

# SSH接続を有効にする
# set system services ssh

# Telnet接続を有効にする
# set system services telnet

# 参考_GUI(WEBインターフェース接続)を有効にする
# set system services web-management http

# commit

ユーザ作成

  • super-user:全ての権限
  • operator:権限のクリア、network、reset、traceおよび表示
  • read-only:閲覧権限
# set system login user hoge class super-user authentication plain-text-password
New password:
Retype new password:

このままだと定期的にログが出力されて邪魔なので、無効化する

# delete chassis auto-image-upgrade

アドレス設定

I/FをL3でIPアドレス設定

インターフェイスにipアドレスを付与してcommitすると、デフォルトでインターフェイスが存在しているせいで、排他的に存在しているとのエラーが出たりする。
'ethernet-switching' Family ethernet-switching and rest of the families are mutually exclusive error: commit failed: (statements constraint check failed)
まず、デフォルトで存在するインターフェイスを排除。

# delete interfaces ge-0/0/0

ge-0/0/0にL3としてIPアドレスを付与。

# set interfaces ge-0/0/0 unit 0 family inet address 192.0.2.1/24

インターフェイスUP。設定を保存。

# delete interfaces ge-0/0/3 disable
# commit

downさせたい場合は

# set interfaces ge-0/0/3 disable

オペレーションモードでインターフェイスを確認

> show interfaces ge-0/0/0
Physical interface: ge-0/0/0, Enabled, Physical link is Up
  Interface index: 644, SNMP ifIndex: 511
  Link-level type: Ethernet, MTU: 1514, Speed: Auto, Duplex: Auto,
  BPDU Error: None, MAC-REWRITE Error: None, Loopback: Disabled,
  Source filtering: Disabled, Flow control: Enabled, Auto-negotiation: Enabled,
  Remote fault: Online, Media type: Copper,
  IEEE 802.3az Energy Efficient Ethernet: Disabled
  Device flags   : Present Running
  Interface flags: SNMP-Traps Internal: 0x0
  Link flags     : None
  CoS queues     : 12 supported, 12 maximum usable queues
  Current address: xx:xx:xx:xx:xx:xx, Hardware address: xx:xx:xx:xx:xx:xx
  Last flapped   : 2023-01-16 07:43:05 JST (2d 00:39 ago)
  Input rate     : 3496 bps (4 pps)
  Output rate    : 632 bps (1 pps)
  Active alarms  : None
  Active defects : None
  Interface transmit statistics: Disabled

  Logical interface ge-0/0/0.0 (Index 584) (SNMP ifIndex 512)
    Flags: SNMP-Traps 0x0 Encapsulation: ENET2
    Input packets : 1703
    Output packets: 794
---(more)---[abort]

{master:0}

VLANにIPアドレスを設定

名前と VLAN ID を割り当てて、VLAN を作成します。

# set vlans ssl-vpn vlan-id 250

デフォルトで存在するインターフェイスを排除。

# delete interfaces ge-0/0/5

論理インターフェイスを指定し( unit ステートメントを使用)、VLAN 名をメンバーとして指定して、VLAN にインターフェイスを割り当てます。

# set interfaces ge-0/0/5 unit 0 family ethernet-switching vlan members ssl-vpn

仮想的なVLANインターフェースにIPアドレスを設定。

# set interfaces irb unit 250 family inet address 192.168.0.1/24

レイヤー 3 インターフェイスを VLAN にバインドします

# set vlans ssl-vpn l3-interface irb.250

アクセスモードに設定

# set interfaces ge-0/0/5 unit 0 family ethernet-switching interface-mode access

必要ならDefaultRootを指定。

# set routing-options static route 0.0.0.0/0 next-hop x.x.x.x

commit前の設定前と設定された後の確認コマンド

# show | compare
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?