network:cisco:setup_cisco_router_from_initial_to_ssh_login

差分

このページの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ログインできるまで設定する ======
  
 +設定が一切ない場合、起動時に「初期設定するか?」と聞かれるがお断りする。
 +
 +<code>
          --- 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
 +</code>
  
-特権EXECに入る+特権EXECに入り、パスワードを設定す。 
 +<code>
 Router>enable Router>enable
 Router# Router#
 +Router(config)#enable password PASSWORD
 +Router(config)#service password-encryption 
 +<code>
 +
  
 インタフェースを見てみる。 インタフェースを見てみる。
行 54: 行 63:
 Router(config)#line console 0 Router(config)#line console 0
 Router(config-line)#logging synchronous  Router(config-line)#logging synchronous 
-Router(config-line)#exit 
- 
  
 インターフェースの有効化 インターフェースの有効化
行 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)#do show vlan-switch
 +
 +VLAN Name                             Status    Ports
 +---- -------------------------------- --------- -------------------------------
 +1    default                          active    Gi0, Gi1, Gi2, Gi3, Gi4, Gi5
 +                                                Gi6, Gi7
 +1002 fddi-default                     act/unsup 
 +1003 token-ring-default               act/unsup 
 +1004 fddinet-default                  act/unsup 
 +1005 trnet-default                    act/unsup 
 +
 +VLAN Type  SAID       MTU   Parent RingNo BridgeNo Stp  BrdgMode Trans1 Trans2
 +---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
 +1    enet  100001     1500  -      -      -        -    -        1002   1003
 +1002 fddi  101002     1500  -      -      -        -    -        1      1003
 +1003 tr    101003     1500  1005        -        -    srb      1      1002
 +1004 fdnet 101004     1500  -      -      1        ibm  -        0      0   
 +1005 trnet 101005     1500  -      -      1        ibm  -        0      0   
 +
 +
 +Router(config)#interface vlan 1 
 +Router(config-if)#ip address 172.16.0.254 255.255.0.0
 +Router(config-if)#no shutdown デフォで有効になっているが念のため
 +
 +疎通確認
 +$ ping 172.16.0.254
 +PING 172.16.0.254 (172.16.0.254): 56 data bytes
 +64 bytes from 172.16.0.254: icmp_seq=0 ttl=255 time=3.138 ms
 +64 bytes from 172.16.0.254: icmp_seq=1 ttl=255 time=0.675 ms
 +^C
 +--- 172.16.0.254 ping statistics ---
 +2 packets transmitted, 2 packets received, 0.0% packet loss
 +round-trip min/avg/max/stddev = 0.675/1.906/3.138/1.231 ms
 +
 +sshのアカウント作成
 +Router(config)#username USERNAME password PASSWORD
 +
 +Router(config)#line vty 0 4
 +Router(config-line)#login local
 +
 +SSHのみ許可
 +Router(config-line)#transport input ssh
 +
 +ホスト名とドメイン名の設定
 +Router(config)#hostname RT
 +RT(config)#ip domain-name example.com
 +
 +暗号鍵の設定
 +RT(config)#crypto key generate RSA             
 +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)#ip ssh version 2
 +
 +設定保存
 +RT#write
 +
 +*Jan  8 12:54:57.493: %SYS-5-CONFIG_I: Configured from console by console
 +Building configuration...
 +[OK]
 +
 +$ ssh Decomo@172.16.0.254
 +Password: 
 +RT>
 +
  
  • network/cisco/setup_cisco_router_from_initial_to_ssh_login.1483865486.txt.gz
  • 最終更新: 2017-01-08 17:51
  • by Decomo