差分
このページの2つのバージョン間の差分を表示します。
network:cisco:setup_cisco_router_from_initial_to_ssh_login [2017-01-08 17:51] Decomo 作成 |
network:cisco:setup_cisco_router_from_initial_to_ssh_login [2017-01-11 09:17] (現在) Decomo |
||
---|---|---|---|
行 1: | 行 1: | ||
====== Ciscoルータを初期状態からsshログインできるまで設定する ====== | ====== Ciscoルータを初期状態からsshログインできるまで設定する ====== | ||
+ | 設定が一切ない場合、起動時に「初期設定するか?」と聞かれるがお断りする。 | ||
+ | |||
+ | < | ||
--- System Configuration Dialog --- | --- System Configuration Dialog --- | ||
Would you like to enter the initial configuration dialog? [yes/no]: n | Would you like to enter the initial configuration dialog? [yes/no]: n | ||
+ | </ | ||
- | 特権EXECに入る | + | 特権EXECに入り、パスワードを設定する。 |
+ | < | ||
Router> | Router> | ||
Router# | Router# | ||
+ | Router(config)# | ||
+ | Router(config)# | ||
+ | < | ||
+ | |||
インタフェースを見てみる。 | インタフェースを見てみる。 | ||
行 54: | 行 63: | ||
Router(config)# | Router(config)# | ||
Router(config-line)# | Router(config-line)# | ||
- | Router(config-line)# | ||
- | |||
インターフェースの有効化 | インターフェースの有効化 | ||
行 66: | 行 73: | ||
有効になったか確認 | 有効になったか確認 | ||
- | #do show interfaces | + | Router(config-if)#do show interfaces |
GigabitEthernet0 is up, line protocol is up | GigabitEthernet0 is up, line protocol is up | ||
Hardware is Gigabit Ethernet, address is 0081.c4ae.ad97 (bia 0081.c4ae.ad97) | Hardware is Gigabit Ethernet, address is 0081.c4ae.ad97 (bia 0081.c4ae.ad97) | ||
行 74: | 行 81: | ||
インタフェースの数だけ繰り返す。 | インタフェースの数だけ繰り返す。 | ||
+ | |||
+ | VLANの状態を確認してみる。 | ||
+ | Router(config)# | ||
+ | |||
+ | VLAN Name | ||
+ | ---- -------------------------------- --------- ------------------------------- | ||
+ | 1 default | ||
+ | Gi6, Gi7 | ||
+ | 1002 fddi-default | ||
+ | 1003 token-ring-default | ||
+ | 1004 fddinet-default | ||
+ | 1005 trnet-default | ||
+ | |||
+ | VLAN Type SAID | ||
+ | ---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------ | ||
+ | 1 enet 100001 | ||
+ | 1002 fddi 101002 | ||
+ | 1003 tr 101003 | ||
+ | 1004 fdnet 101004 | ||
+ | 1005 trnet 101005 | ||
+ | |||
+ | |||
+ | Router(config)# | ||
+ | Router(config-if)# | ||
+ | Router(config-if)# | ||
+ | |||
+ | 疎通確認 | ||
+ | $ ping 172.16.0.254 | ||
+ | PING 172.16.0.254 (172.16.0.254): | ||
+ | 64 bytes from 172.16.0.254: | ||
+ | 64 bytes from 172.16.0.254: | ||
+ | ^C | ||
+ | --- 172.16.0.254 ping statistics --- | ||
+ | 2 packets transmitted, | ||
+ | round-trip min/ | ||
+ | |||
+ | sshのアカウント作成 | ||
+ | Router(config)# | ||
+ | |||
+ | Router(config)# | ||
+ | Router(config-line)# | ||
+ | |||
+ | SSHのみ許可 | ||
+ | Router(config-line)# | ||
+ | |||
+ | ホスト名とドメイン名の設定 | ||
+ | Router(config)# | ||
+ | RT(config)# | ||
+ | |||
+ | 暗号鍵の設定 | ||
+ | RT(config)# | ||
+ | The name for the keys will be: RT-L01-01.tokyo.lan.decomo.info | ||
+ | Choose the size of the key modulus in the range of 360 to 4096 for your | ||
+ | General Purpose Keys. Choosing a key modulus greater than 512 may take | ||
+ | a few minutes. | ||
+ | |||
+ | How many bits in the modulus [512]: 2048 | ||
+ | % Generating 2048 bit RSA keys, keys will be non-exportable... | ||
+ | [OK] (elapsed time was 1 seconds) | ||
+ | |||
+ | SSHのバージョン2を使う | ||
+ | RT(config)# | ||
+ | |||
+ | 設定保存 | ||
+ | RT#write | ||
+ | |||
+ | *Jan 8 12: | ||
+ | Building configuration... | ||
+ | [OK] | ||
+ | |||
+ | $ ssh Decomo@172.16.0.254 | ||
+ | Password: | ||
+ | RT> | ||
+ | |||