キャンセル
次の結果を表示 
次の代わりに検索 
もしかして: 
cancel
8106
閲覧回数
5
いいね!
0
コメント

ルータを SSL-VPN ゲートウェイとして動作させる環境などで、サーバ証明書が必要になる場合があります。
デフォルトでは自己署名証明書が自動的に生成されますが、たとえば Cisco AnyConnect によるリモート アクセス SSL-VPN 環境では、証明書の Extended Key Usage(EKU)属性で Server Auth が設定されている必要があるため、EKU 属性をもたない自己署名証明書ではエラーが発生します
このようなケースに対処するため、Cisco IOS の CA サーバ機能を利用してルータ自体が認証局となることで(ローカル CA)、1 つのルータ内でそのルータ向けのサーバ証明書を発行する方法について説明します。
ここでは、比較的簡単な Simple Certificate Enrollment Protocol(SCEP)を使用した設定例をベースに説明します。
また、この設定例では、WAN インターフェイスの IP アドレスを 1.178.100.128 としています。

まず、ローカル CA サーバを設定します。

ステップ①:CLI にアクセスしてログイン、グローバル コンフィギュレーション モードに移行

Router#configure terminal

ステップ②(オプション):NTP サーバと同期

Router(config)#ntp server time.nist.gov

【メモ】
この入力例では、time.nist.gov と同期しています。
クイック セットアップ ウィザードで NTP サーバと同期するように設定した場合、このコマンドは必要ありません。
show ntp status コマンドで、同期しているかどうか確認できます。同期している場合は Clock is synchronized、同期していない場合は Clock is unsynchronized と表示されます。

ステップ③:ドメイン名および CN(コモン ネーム)を設定

Router(config)#ip domain name ac-test.local
Router(config)#ip http server
Router(config)#ip http access-class 23
Router(config)#access-list 23 permit any
Router(config)#crypto pki server LOCAL-CA
Router(cs-server)#issuer-name cn="1.178.100.128"

【メモ】
この入力例では、ドメインを保有していない前提で、ip domain name を任意の ac-test.local、issuer-name cn を WAN インターフェイスの IP アドレス 1.178.100.128 としています。ドメインを保有している場合は、その内容に合わせてドメイン名および CN を入力してください。

【注意】
クイック セットアップ ウィザードを使用して初期セットアップを完了した場合、ip http server にはアクセス コントロール リストが設定されるため(たとえば access-list 23 permit 10.10.10.0 0.0.0.127)、そのままでは特定の送信元 IP アドレスからしかアクセスできず、設定の途中でエラーが発生します。そこで、この入力例では、access-list 23 permit any コマンドで、任意の送信元 IP アドレスからアクセスできるようにしています。

ステップ④:証明書の有効期限を設定

Router(cs-server)#lifetime ca-certificate 3650
Router(cs-server)#lifetime certificate 3650

【メモ】
この入力例では、CA 証明書および ID 証明書の有効期限を 10 年に設定しています。デフォルトでは、CA 証明書の有効期限は 3 年、ID 証明書 の有効期限は 1 年です。証明書の管理ポリシーに応じて設定してください。

ステップ⑤:EKU 属性に Server Auth を設定

Router(cs-server)#eku server-auth

ステップ⑥:SCEP を有効化

Router(cs-server)#grant auto

ステップ⑦:CA サーバを起動、任意のパスワードを設定

Router(cs-server)#no shutdown
%Some server settings cannot be changed after CA certificate generation.
% Please enter a passphrase to protect the private key
% or type Return to exit
Password:

Re-enter password:

% Certificate Server enabled.

次に、サーバ証明書を発行します。

ステップ⑧:RSA キー ペアを生成

Router(cs-server)#crypto key generate rsa modulus 1024 label TP_SERVER_CERT exportable
The name for the keys will be: TP_SERVER_CERT

% The key modulus size is 1024 bits
% Generating 1024 bit RSA keys, keys will be exportable...
[OK] (elapsed time was 1 seconds)

ステップ⑨:トラストポイントを設定

Router(config)#crypto pki trustpoint TP_SERVER_CERT
Router(ca-trustpoint)#enrollment url http://1.178.100.128:80
Router(ca-trustpoint)#subject-name cn="1.178.100.128"
Router(ca-trustpoint)#rsakeypair TP_SERVER_CERT
Router(ca-trustpoint)#exit

ステップ⑩:CA 証明書を取得

Router(config)#crypto pki authenticate TP_SERVER_CERT
Certificate has the following attributes:
Fingerprint MD5: A4693B35 FB731558 DF566125 598B4C74
Fingerprint SHA1: DE313F8F 55676977 5F099043 F9353EFA 130C39FB

% Do you accept this certificate? [yes/no]: yes
Trustpoint CA certificate accepted.

ステップ⑪:サーバ証明書を取得

Router(config)#crypto pki enroll TP_SERVER_CERT
%
% Start certificate enrollment ..
% Create a challenge password. You will need to verbally provide this
password to the CA Administrator in order to revoke your certificate.
For security reasons your password will not be saved in the configuration.
Please make a note of it.

Password:
Re-enter password:

% The subject name in the certificate will include: cn="1.178.100.128"
% The subject name in the certificate will include: Router.ac-test.local
% Include the router serial number in the subject name? [yes/no]: no
% Include an IP address in the subject name? [no]: no
Request certificate from CA? [yes/no]: yes
% Certificate request sent to Certificate Authority
% The 'show crypto pki certificate verbose TP_SERVER_CERT' commandwill show the fingerprint.

Router(config)#exit

サーバ証明書の作成が完了しました。念のため、設定内容を確認してください。

ステップ⑫(オプション):CA サーバの設定を確認

Router#show crypto pki server
Certificate Server LOCAL-CA:
Status: enabled
State: enabled
Server's configuration is locked (enter "shut" to unlock it)
Issuer name: cn="1.178.100.128"
CA cert fingerprint: A4693B35 FB731558 DF566125 598B4C74
Granting mode is: auto
Last certificate issued serial number (hex): 2
CA certificate expiration timer: 14:08:18 GMT Jun 20 2027
CRL NextUpdate timer: 20:08:18 GMT Jun 22 2017
Current primary storage dir: nvram:
Database Level: Minimum - no cert data written to storage

ステップ⑬(オプション):トラストポイントの設定を確認

Router#show crypto pki trustpoints
Trustpoint TP-self-signed-2973459327:
Subject Name:
cn=IOS-Self-Signed-Certificate-2973459327
Serial Number (hex): 01
Persistent self-signed certificate trust point
Using key label TP-self-signed-2973459327

Trustpoint LOCAL-CA:
Subject Name:
cn=1.178.100.128
Serial Number (hex): 01
Certificate configured.

Trustpoint TP_SERVER_CERT:
Subject Name:
cn=1.178.100.128
Serial Number (hex): 01
Certificate configured.
SCEP URL: http://1.178.100.128:80/cgi-bin

ステップ⑭(オプション):証明書の設定を確認

Router#show crypto pki certificates verbose
Certificate
Status: Available
Version: 3
Certificate Serial Number (hex): 02
Certificate Usage: General Purpose
Issuer:
cn=1.178.100.128
Subject:
Name: Router.ac-test.local
hostname=Router.ac-test.local
cn=1.178.100.128
Validity Date:
start date: 14:10:00 GMT Jun 22 2017
end date: 14:08:18 GMT Jun 20 2027
Subject Key Info:
Public Key Algorithm: rsaEncryption
RSA Public Key: (1024 bit)
Signature Algorithm: SHA1 with RSA Encryption
Fingerprint MD5: 3C02D579 7A3D121D 257F9539 DBF09D0B
Fingerprint SHA1: 60D2200A 5FC8BCB5 4372F706 880825E4 9674E0DE
X509v3 extensions:
X509v3 Key Usage: A0000000
Digital Signature
Key Encipherment
X509v3 Subject Key ID: AFA0EF91 4FECCA32 66400B26 AF513564 63EC76B2
X509v3 Authority Key ID: 1AC16F63 15FE1EC3 37D14662 41706600 9F1D22E6
Authority Info Access:
Extended Key Usage:
Server Auth
Associated Trustpoints: TP_SERVER_CERT
Key Label: TP_SERVER_CERT

CA Certificate
Status: Available
Version: 3
Certificate Serial Number (hex): 01
Certificate Usage: Signature
Issuer:
cn=1.178.100.128
Subject:
cn=1.178.100.128
Validity Date:
start date: 14:08:18 GMT Jun 22 2017
end date: 14:08:18 GMT Jun 20 2027
Subject Key Info:
Public Key Algorithm: rsaEncryption
RSA Public Key: (1024 bit)
Signature Algorithm: MD5 with RSA Encryption
Fingerprint MD5: A4693B35 FB731558 DF566125 598B4C74
Fingerprint SHA1: DE313F8F 55676977 5F099043 F9353EFA 130C39FB
X509v3 extensions:
X509v3 Key Usage: 86000000
Digital Signature
Key Cert Sign
CRL Signature
X509v3 Subject Key ID: 1AC16F63 15FE1EC3 37D14662 41706600 9F1D22E6
X509v3 Basic Constraints:
CA: TRUE
X509v3 Authority Key ID: 1AC16F63 15FE1EC3 37D14662 41706600 9F1D22E6
Authority Info Access:
Associated Trustpoints: TP_SERVER_CERT LOCAL-CA

Router Self-Signed Certificate
Status: Available
Version: 3
Certificate Serial Number (hex): 01
Certificate Usage: General Purpose
Issuer:
cn=IOS-Self-Signed-Certificate-2973459327
Subject:
Name: IOS-Self-Signed-Certificate-2973459327
cn=IOS-Self-Signed-Certificate-2973459327
Validity Date:
start date: 13:31:20 GMT Jun 22 2017
end date: 09:00:00 GMT Jan 1 2020
Subject Key Info:
Public Key Algorithm: rsaEncryption
RSA Public Key: (1024 bit)
Signature Algorithm: SHA1 with RSA Encryption
Fingerprint MD5: 4DF93CA4 7C2704F5 6210143F 6CFA435B
Fingerprint SHA1: 65BD429A C40F0806 954E5764 107FD1DE 4FBE22E9
X509v3 extensions:
X509v3 Subject Key ID: 545E7BFD 87B95454 16B981D8 DCD3EAA0 7FF7A889
X509v3 Basic Constraints:
CA: TRUE
X509v3 Authority Key ID: 545E7BFD 87B95454 16B981D8 DCD3EAA0 7FF7A889
Authority Info Access:
Associated Trustpoints: TP-self-signed-2973459327
Storage: nvram:IOS-Self-Sig#25.cer

【メモ】
サーバ証明書が TP_SERVER_CERT トラストポイントに関連付けられていること(Associated Trustpoints: TP_SERVER_CERT)、CA 証明書が TP_SERVER_CERT および LOCAL-CA トラストポイントに関連付けられていること(Associated Trustpoints: TP_SERVER_CERT LOCAL-CA)が確認できます。

Getting Started

検索バーにキーワード、フレーズ、または質問を入力し、お探しのものを見つけましょう

シスコ コミュニティをいち早く使いこなしていただけるよう役立つリンクをまとめました。みなさんのジャーニーがより良いものとなるようお手伝いします