NEC UNIVERGE IX2105をもっとも単純なルーターにしてみた

NEC UNIVERGE IX2105をもっとも単純なルーターにしてみた

うちの、LAN群を接続するルーターの1つは、NanoPi NEO2にUSB LANアダプタを装着したものでした。しかし、シングルボードコンピュータは一般にハードウェアの耐久性が低く、数年で故障することが珍しくありません。NanoPi NEO2も、感覚的には長く使えた部類ですが、それでも8年で故障してしまいました。
次のルーターとしては、NICを2基搭載したシングルボードコンピュータの購入も考えましたが、最近はシングルボードコンピュータの価格が上昇しており、単にLANとLANを接続するだけの用途としてはコストパフォーマンスが悪いと判断しました。そこで、以前「がとらぼ」でも一度だけ取り上げたNEC製のルーター「IX2015」を四次元クローゼットから引っ張り出して、代替機として利用することにしました。
IX2015は設定が簡単な反面、ネットワークポートの通信速度が最大100Mbpsまでに制限されています。現代のネットワーク環境では100Mbpsはかなり遅く感じられますし、L2スイッチのランプの色が変わってしまう点も気分的に好ましくありません。

そこでヤフオクを探してみたところ、IX2015の後継モデルである「NEC UNIVERGE IX2105」を発見しました。IX2105はGigabit Ethernet(GbE)に対応しているため、通信速度の問題は解消されます。さらに、IX2106やIX2107といった後発モデルに比べて機能面では劣りますが、その分人気がなく、価格も大幅に控えめです。ヤフオクではIX2105は1,000〜3,000円程度で取引されているのに対し、IX2106は1万円前後、IX2107は数万円の価格がついています。
今回の用途は単純なルーターですので、IX2105で十分すぎるほどです。

NEC UNIVERGE IX2105をもっとも単純なルーターにしてみた 1
今回はヤフオクでIX2105を1,000円で落札しました。別途送料がかかるため、総額では実質2,000円ほどとなりました。NICが2つ搭載されたシングルボードコンピュータを新規に購入する場合と比べて、コストを1/3以下に抑えることができました。

NEC UNIVERGE IX2105をもっとも単純なルーターにしてみた 2
IX2105は、旧モデルのIX2015よりも一回り、二回りほど小型で、サイズ感としてはCDケースに近い印象です。重量もかなり軽く、持ち運びにも便利です。
筐体内部は非常にシンプルで、基板1枚と電源回路が収められているだけに見えます。正面には左から順に、CONSOLEポート(シリアルポート)、GE0(ネットワークポート0)、GE1(GbEのハブポート)が並んでいます。

NEC UNIVERGE IX2105をもっとも単純なルーターにしてみた 4
背面と底面の構造も簡素です。
背面には、左から順にIXシリーズではおなじみの電源ケーブル抜け防止バンド、3ピンのAC電源ソケット、電源スイッチ、ケンジントンロック用の穴があります。
底面には、小さくて薄い4つのゴム足がついており、中央部には機器の仕様などが記載されたラベルが貼られていました。

NEC UNIVERGE IX2105をもっとも単純なルーターにしてみた 4
ヤフオクで購入したIX2105にはシリアルケーブルが付属していなかったため、IX2015に付属していたものを流用しました。このシリアルケーブルは一方が9ピンのD-Sub(RS-232C)コネクタで、もう一方がRJ45コネクタになっています。
また、右下に写っている半透明の黒っぽいデバイスはUSBシリアル変換アダプタです。最近の小型PCにはシリアルポートが搭載されていないことが多いため、シリアル通信を行う際にはこのようなアダプタが必要になります。写真のものは非常に古いアダプタですが、現在でも問題なく動作しています。

IX2105は初期化済みの個体であれば、いずれかのGEポートに「192.168.1.254」のIPアドレスが割り当てられており、telnetやウェブコンソールからのアクセスが可能な場合もあるようです(未確認)。ただし、今回は前述のシリアルケーブルがあるため、シリアル通信を使用して設定を行うことにしました。

まず最初に、シリアルケーブルをIX2105のCONSOLEポートに接続します。この時点では、IX2105の電源はまだ入れません。

次に、シリアルケーブルのD-Sub9ピン側(今回はUSBアダプタを装着)をPCに接続しますが、その前にターミナルで一度 $ ls /dev を実行しておきます。その後、USBアダプタをPCのUSBポートに挿すことで、物理的にはPCとIX2105が接続された状態になります。

USBシリアルデバイスを確認

$ ls /dev
autofs           hidraw1    log           nvme0n1p2  tty11  tty32  tty53   ttyS16  ttyS9        vcsa6
block            hidraw2    loop-control  nvme0n1p3  tty12  tty33  tty54   ttyS17  ttyUSB0      vcsu
btrfs-control    hidraw3    loop0         nvram      tty13  tty34  tty55   ttyS18  ttyprintk    vcsu1
bus              hidraw4    loop1         port       tty14  tty35  tty56   ttyS19  udmabuf      vcsu2
char             hidraw5    loop10        ppp        tty15  tty36  tty57   ttyS2   uhid         vcsu3
console          hpet       loop2         psaux      tty16  tty37  tty58   ttyS20  uinput       vcsu4
core             hugepages  loop3         ptmx       tty17  tty38  tty59   ttyS21  urandom      vcsu5
cpu              hwrng      loop4         pts        tty18  tty39  tty6    ttyS22  usb          vcsu6
cpu_dma_latency  i2c-0      loop5         random     tty19  tty4   tty60   ttyS23  userfaultfd  vfio
cuse             i2c-1      loop6         rfkill     tty2   tty40  tty61   ttyS24  userio       vga_arbiter
disk             i2c-2      loop7         rtc        tty20  tty41  tty62   ttyS25  vcs          vhci
dma_heap         i2c-3      loop8         rtc0       tty21  tty42  tty63   ttyS26  vcs1         vhost-net
dri              i2c-4      loop9         serial     tty22  tty43  tty7    ttyS27  vcs2         vhost-vsock
drm_dp_aux0      i2c-5      mapper        shm        tty23  tty44  tty8    ttyS28  vcs3         zero
drm_dp_aux1      i2c-6      mcelog        snapshot   tty24  tty45  tty9    ttyS29  vcs4         zfs
drm_dp_aux2      i2c-7      mem           snd        tty25  tty46  ttyS0   ttyS3   vcs5
ecryptfs         i2c-8      mqueue        stderr     tty26  tty47  ttyS1   ttyS30  vcs6
fb0              i2c-9      net           stdin      tty27  tty48  ttyS10  ttyS31  vcsa
fd               initctl    ng0n1         stdout     tty28  tty49  ttyS11  ttyS4   vcsa1
full             input      null          tty        tty29  tty5   ttyS12  ttyS5   vcsa2
fuse             kfd        nvme0         tty0       tty3   tty50  ttyS13  ttyS6   vcsa3
gpiochip0        kmsg       nvme0n1       tty1       tty30  tty51  ttyS14  ttyS7   vcsa4
hidraw0          kvm        nvme0n1p1     tty10      tty31  tty52  ttyS15  ttyS8   vcsa5

上記では「ttyUSB0」を見やすくするために黄色で表示していますが、実際のターミナル上では色は付きません。USBケーブル接続前と接続後で ls /dev の出力を比較し、追加されたデバイス名がシリアルUSBデバイスです。
今回使用したLinux環境では、USBシリアルデバイスは「ttyUSB0」として認識されましたが、他のOSでは異なるデバイス名となる場合があります。

USBシリアルデバイスとして認識された「ttyUSB0」を使用します。パスとしては /dev/ttyUSB0 を指定します。

IX2105の電源をオフにした状態で、コンソールからシリアル通信を開始します。

$ cu -l /dev/ttyUSB0 -s 9600
Connected.   このconnected.はUSBシリアルアダプタが応答しています

ここで、IX2105の電源をオンにします。

NEC Diagnostic Software
Copyright (c) NEC Corporation 2001-2016. All rights reserved.

%DIAG-INFO: Starting System POST(Power On Self Test)

               DRAM TEST 1: Pass
               DRAM TEST 2: Pass
                NVRAM TEST: Pass
                  CPU TEST: Pass
                  PLD TEST: Pass
                  GE0 TEST: Pass
       GE1(SW-HUB)1-4 TEST: Pass
        1.0 VOLTAGE STATUS: 0.973V Pass
        1.8 VOLTAGE STATUS: 1.777V Pass
        2.5 VOLTAGE STATUS: 2.457V Pass
        3.3 VOLTAGE STATUS: 3.268V Pass
        5.0 VOLTAGE STATUS: 5.044V Pass
        TEMPERATURE STATUS: +21.0degC Pass

NEC Bootstrap Software
Copyright (c) NEC Corporation 2001-2016. All rights reserved.

%BOOT-INFO: Trying flash load, exec-image [ix2105-ms-9.3.11.ldc].
Loading: ############################################################################# [OK]


Starting at 0x20000

Configuring router subsystems (before IDB proc): done.
Constructing IDB(Interface Database): done.
Configuring router subsystems (after IDB proc): done.
Initializing router subsystems: done.
Starting router subsystems: done.

All router subsystems coming up.



NEC Portable Internetwork Core Operating System Software
Copyright Notices:
Copyright (c) NEC Corporation 2001-2016. All rights reserved.
Copyright (c) 1985-1998 OpenROUTE Networks, Inc.
Copyright (c) 1984-1987, 1989 J. Noel Chiappa.
Router# enable-config   設定モードにする
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)# show config   現在の設定を表示
% Non-volatile configuration memory is not present
Router(config)# exit   設定モードを抜ける

   設定が空なので初期化済みというのは正しそうだが、一応もう一度初期化する

Router# restart   初期化のために再起動する
Notice: The router will be RELOADED instead of a RESTART on
        this hardware platform.
Notice: The router will be RELOADED. This is to ensure that
        the peripheral devices are properly initialized.
Are you sure you want to reload the router? (Yes or [No]): yes   Yesを入力する


NEC Bootstrap Software
Copyright (c) NEC Corporation 2001-2016. All rights reserved.

%BOOT-INFO: Trying flash load, exec-image [ix2105-ms-9.3.11.ldc].
Loading: ##############################   ##が伸び切る前に[Ctrl]+[C]
NEC Bootstrap Software, Version 12.1
Copyright (c) NEC Corporation 2001-2016. All rights reserved.
boot[1]> cc   ccで初期化
Enter "Y" to clear startup configuration: y   yを押す
% Startup configuration is cleared.

NEC Bootstrap Software, Version 12.1
Copyright (c) NEC Corporation 2001-2016. All rights reserved.
boot[1]> b   bで起動する

NEC Bootstrap Software
Copyright (c) NEC Corporation 2001-2016. All rights reserved.

%BOOT-INFO: Trying flash load, exec-image [ix2105-ms-9.3.11.ldc].
Loading: ############################################################################# [OK]


Starting at 0x20000

Configuring router subsystems (before IDB proc): done.
Constructing IDB(Interface Database): done.
Configuring router subsystems (after IDB proc): done.
Initializing router subsystems: done.
Starting router subsystems: done.

All router subsystems coming up.



NEC Portable Internetwork Core Operating System Software
Copyright Notices:
Copyright (c) NEC Corporation 2001-2016. All rights reserved.
Copyright (c) 1985-1998 OpenROUTE Networks, Inc.
Copyright (c) 1984-1987, 1989 J. Noel Chiappa.
Router#

初期化済みで起動完了

Router# enable-config   設定モードにする
Enter configuration commands, one per line. End with CNTL/Z.

Router(config)# hostname ix2105   ホスト名
Router(config)# timezone +09 00   タイムゾーン(日本)

Router(config)# username admin password plain 平文パスワード administrator   adminという管理者ユーザーを作成


Router(config)# ntp ip enable   NTPサーバ有効化
Router(config)# ntp server 192.168.0.123   参照NTPサーバ指定
Router(config)# ntp server 192.168.4.123   参照NTPサーバ指定

Router(config)# ip route default 192.168.0.1 GigaEthernet0.0   デフォルトルート
Router(config)# ip route default 192.168.1.1 GigaEthernet1.0   デフォルトルート

Router(config)# ip dhcp enable   DHCPサーバ有効化

Router(config)# ip access-list lan_acl permit ip src 192.168.0.0/24 dest 192.168.0.0/24   lan_aclというACLルール
Router(config)# ip access-list lan_acl permit ip src 192.168.4.0/24 dest 192.168.4.0/24   lan_aclというACLルール(追加)
Router(config)# ip access-list lan_acl deny ip src any dest any   lan_aclというACLルール(追加)
Router(config)# ip access-list flt-in-p permit ip src 192.168.0.0/24 dest any   flt-in-pというACLルール
Router(config)# ip access-list flt-in-p permit ip src 192.168.4.0/24 dest any   flt-in-pというACLルール(追加)
Router(config)# ip access-list flt-out-p permit ip src any dest 192.168.0.0/24   flt-out-pというACLルール
Router(config)# ip access-list flt-out-p permit ip src any dest 192.168.4.0/24   flt-out-pというACLルール(追加)
Router(config)# ip access-list flt-d deny ip src any dest any   flt-dというACLルール

Router(config)# arp auto-refresh
Router(config)# ip name-server 192.168.0.1
Router(config)# proxy-dns ip enable
Router(config)# telnet-server ip access-list lan_acl   telnet管理アクセスへのACLルールはlan_acl
Router(config)# telnet-server ip enable   telnet管理アクセスの有効化
Router(config)# http-server username admin   ユーザーadminにtelnet管理アクセスを許す
Router(config)# http-server ip access-list lan_acl   ウェブ管理アクセスへのACLルールはlan_acl
Router(config)# http-server ip enable   ユーザーadminにウェブ管理アクセスを許す

Router(config)# ip dhcp profile devlan   devlanというDHCPプロファイルの設定階層に入る
Router(config-dhcp-devlan)# assignable-range 192.168.4.64 192.168.4.254   DHCPサーバのリース範囲を指定
Router(config-dhcp-devlan)# default-gateway 192.168.4.1   DHCPサーバのデフォルトルート指定
Router(config-dhcp-devlan)# dns-server 192.168.0.1   DHCPクライアント用DNSサーバを指定
Router(config-dhcp-devlan)# lease-time 86400   DHCPリース時間(秒)
Router(config-dhcp-devlan)# fixed-assignment 192.168.4.8 00:00:00:00:00:00   特定デバイス(MACアドレス)への固定IP 
Router(config-dhcp-devlan)# exit   devlanというDHCPプロファイルの設定階層を抜ける

Router(config)# interface GigaEthernet0.0   GE0の設定階層に入る
Router(config-GigaEthernet0.0)# ip address 192.168.0.6/24   GE0に192.168.0.6/255.255.255.0を指定する
Router(config-GigaEthernet0.0)# ip filter flt-in-p 1 in suppress-logging   GE0へのフィルタリング設定(4行)
Router(config-GigaEthernet0.0)# ip filter flt-d 2 in suppress-logging
Router(config-GigaEthernet0.0)# ip filter flt-out-p 1 out suppress-logging
Router(config-GigaEthernet0.0)# ip filter flt-d 2 out suppress-logging
Router(config-GigaEthernet0.0)# no shutdown   GE0をずっと切断しない/設定有効化(起動)
Router(config-GigaEthernet0.0)# exit   GE0の設定階層を抜ける

Router(config)# interface GigaEthernet1.0   GE1.0の設定階層に入る
Router(config-GigaEthernet1.0)# ip address 192.168.4.1/24   GE1.0に192.168.4.1/255.255.255.0を指定する
Router(config-GigaEthernet1.0)# ip filter flt-in-p 1 in suppress-logging   GE1.0へのフィルタリング設定(4行)
Router(config-GigaEthernet1.0)# ip filter flt-d 2 in suppress-logging
Router(config-GigaEthernet1.0)# ip filter flt-out-p 1 out suppress-logging
Router(config-GigaEthernet1.0)# ip filter flt-d 2 out suppress-logging
Router(config-GigaEthernet1.0)# no shutdown   GE1.0をずっと切断しない/設定有効化(起動)
Router(config-GigaEthernet1.0)# ip dhcp binding devlan   GE1.0でdevlanプロファイルのDHCPを動作させる(起動はトップ階層のip dhcp enableによる)
Router(config-GigaEthernet1.0)# exit   GE0の設定階層を抜ける

Router(config)# write memory   設定の保存

Router(config)# exit   設定終了

Router# reboot   再起動する

設定コマンドの多くは実行直後から動作に反映されますが、その時点ではまだ設定は保存されていません。設定を保存するには、設定モードで write memory コマンドを実行する必要があります。
なお、show config コマンドで表示される設定内容は「保存済みの設定」のみであるため、設定変更後に write memory を行わないと、表示内容と実機の動作にズレが生じることに注意してください。

ユーザーアカウントパスワードを平文(plain)で登録しても、show config の出力ではハッシュ化された形式で表示されます。これは、内部的にハッシュとして保存されていることを意味しています。

関連記事:

記事へのコメント

いただいたコメントは管理人が確認した後に記事の 下部(ここ)に公開されます。
コメントスパム対策: 2022年4月以降、コメント内にリンクURLを含めると自動破棄されます。(記録されません)