夜明け前の最も暗いとき

技術的なやったことをメモするブログ

Cisco 892Jを使ったネットワーク構築

ネットワークの構築を覚えるには実際に実機に触って、コンフィグ作成とトラブルシューティングをするのが一番です。 C892JはBGPやOSPFのような大規模ネットワークで使われる動的ルーティングプロトコルをサポートしています。また、VLANやVRFをサポートしているので、一台で複数の論理的なネットワークとルータを作成することができます。他にもVPNQoSなどサポートしており勉強用にいじってみるのには最適だと思います。

CISCO892J-K9

CISCO892J-K9

Amazonなら中古品を2000円から5000円ほどで買うことができます。EOLもまだですし、ネットワークの勉強するには良い製品と言われて自分も買いました。Cisco製品のコンソールポートを使うには、ロールオーバーケーブルとシリアルポートの付いた端末が必要ですが、シリアルポートはもう付いてない端末も多いので、USB変換ケーブルが必須となります。

USB変換ケーブルは最新のOSに対応していないものもあるので、購入前にチェックしておく必要があります。

C892JにはWAN側にGigabitEthernetポート、LAN側にFastEthernetが備わっています。LAN側はL2スイッチとなっており、デフォルトでは全て同じネットワークに属しています。

C892Jの設定に使うソフトウェアはteratermを使用します。teratermでの作業時にはログを取ることが基本となります。ログを取ることによって、あとからどういう作業をしたのか把握することができます。ただ、ログを手動で取得すると忘れることが多いので、自動でログを保存するようにします。

f:id:jianlan:20170701210851j:plain

ファイル名は「20170701(土)_210250_192.168.11.1#22.log」のように、自動で現在時刻とホスト名が入るように設定しています。設定の保存が完了したら、実際にルータに接続します。

f:id:jianlan:20170701212432j:plain

ドライバが正しくインストールされていれば、COMポートから接続できます。電源を投入すると次のような画面が立ち上がってきます。

System Bootstrap, Version 12.4(22r)YB3, RELEASE SOFTWARE (fc1)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 2009 by cisco Systems, Inc.

C890 platform with 524288 Kbytes of main memory

Readonly ROMMON initialized
program load complete, entry point: 0x80020000, size: 0x1cb7a6c
Self decompressing the image : ########################################################################################################################################################################################################################################################################## [OK]

              Restricted Rights Legend

Use, duplication, or disclosure by the Government is
subject to restrictions as set forth in subparagraph
(c) of the Commercial Computer Software - Restricted
Rights clause at FAR sec. 52.227-19 and subparagraph
(c) (1) (ii) of the Rights in Technical Data and Computer
Software clause at DFARS sec. 252.227-7013.

           cisco Systems, Inc.
           170 West Tasman Drive
           San Jose, California 95134-1706



Cisco IOS Software, C890 Software (C890-UNIVERSALK9-M), Version 15.0(1)M3, RELEASE SOFTWARE (fc2)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2010 by Cisco Systems, Inc.
Compiled Sun 18-Jul-10 08:34 by prod_rel_team
Image text-base: 0x800200E4, data-base: 0x83045E40


This product contains cryptographic features and is subject to United
States and local country laws governing import, export, transfer and
use. Delivery of Cisco cryptographic products does not imply
third-party authority to import, export, distribute or use encryption.
Importers, exporters, distributors and users are responsible for
compliance with U.S. and local country laws. By using this product you
agree to comply with applicable laws and regulations. If you are unable
to comply with U.S. and local laws, return this product immediately.

A summary of U.S. laws governing Cisco cryptographic products may be found at:
http://www.cisco.com/wwl/export/crypto/tool/stqrg.html

If you require further assistance please contact us by sending email to
export@cisco.com.

Installed image archive
Cisco 892 (MPC8300) processor (revision 1.0) with 498688K/25600K bytes of memory.
Processor board ID FGLxxxxxxxx

9 FastEthernet interfaces
1 Gigabit Ethernet interface
1 ISDN Basic Rate interface
1 Virtual Private Network (VPN) Module
256K bytes of non-volatile configuration memory.
244440K bytes of ATA CompactFlash (Read/Write)


         --- System Configuration Dialog ---

Would you like to enter the initial configuration dialog? [yes/no]:

ルータが初期化されていれば初期設定を実施するかどうか聞かれますが、行わないのでnoを入力します。

Would you like to enter the initial configuration dialog? [yes/no]: no


Press RETURN to get started!


*Mar  1 00:00:02.211: %IOS_LICENSE_IMAGE_APPLICATION-6-LICENSE_LEVEL: Module name = c890 Next reboot level = advipservices and License = advipservices
(中略)
*Jul  1 12:40:39.115: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet1, changed state to down
*Jul  1 12:40:39.115: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet2, changed state to down
*Jul  1 12:40:39.115: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet3, changed state to down
*Jul  1 12:40:39.119: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet4, changed state to down
*Jul  1 12:40:39.119: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet5, changed state to down
*Jul  1 12:40:39.119: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet6, changed state to down
*Jul  1 12:40:39.119: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet7, changed state to down
Router>

ルータの起動に伴いポートの接続状況を認識します。何もつながっていなければchanged state to downになります。ルータのコンフィグを編集するためにはモードを変える必要があります。cisco製ルータには3つのモードがあり、ユーザモードとイネーブル(特権)モード、コンフィグレーションモードと呼ばれています。ユーザーモードではコマンド入力画面に">“が表示されています。

Router>

ネーブルモードに移行するにはenableコマンドを使用します。

Router>en
Router#

コマンド入力画面に"#“と表示されていればイネーブルモードになっています。この状態でconfigure terminalと打つことでコンフィグレーションモードに移行することができます。

Router#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#

これでコンフィグレーションモードになりました。それでは、LAN側のFastEthernet0にアドレスを割り付けてみます。

Router(config)#int fastEthernet 0
Router(config-if)#ip address 192.168.10.1 255.255.255.0
% IP addresses may not be configured on L2 links FastEthernet0.

Router(config-if)#

LAN側はスイッチ(L2)なので割り付けれないと返ってきました。LAN側にipアドレスを割り付けたいときにはvlanを設定し、それとポートを結びつけます。今回はvlan 10に192.168.10.1を割り当てます。

Router(config)#vlan 10
Router(config-vlan)#exit
Router(config)#int vlan 10
Router(config-if)#ip address 192.168.10.1 255.255.255.0
Router(config-if)#no shutdown
Router(config-if)#exit
Router(config)#int fastEthernet 0
Router(config-if)#switchport access vlan 10
*Jul  1 13:15:44.935: %LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan1, changed state to down
*Jul  1 13:16:14.951: %LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan10, changed state to up

PC側をLANケーブルで接続し、ipアドレスを設定したらpingを実行します。

jianlan@vmdebian:~$ ping 192.168.10.1 -c 4
PING 192.168.10.1 (192.168.10.1) 56(84) bytes of data.
64 bytes from 192.168.10.1: icmp_seq=1 ttl=255 time=0.696 ms
64 bytes from 192.168.10.1: icmp_seq=2 ttl=255 time=0.717 ms
64 bytes from 192.168.10.1: icmp_seq=3 ttl=255 time=0.741 ms
64 bytes from 192.168.10.1: icmp_seq=4 ttl=255 time=0.671 ms

--- 192.168.10.1 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 2999ms
rtt min/avg/max/mdev = 0.671/0.706/0.741/0.031 ms

これで、ネットワークを作成しルータまで疎通させることができました。