Powered by
Movable Type 4.1

メインだよ(カテゴリーアーカイブ)

2006年5月16日

ipsecの設定

■必要なこと
・SAのポリシーの定義 (policy_id、1..255、かぎ交換のポリシーのこと)
・セキュリティゲートウェイの番号 (gateway_id、1.30、接続する相手先のこと)

■トンネルモード

①セキュリティゲートウェイを設定する(gateway_id)
相手先のセキュリティゲートウェイのIPアドレスの設定

# ipsec ike remote address (gateway_id) (相手先のWAN側アドレス)

事前共有鍵の登録

# ipsec ike pre-shared-key (gateway_id) text (仮共有キー)

②SAのポリシーを設定する(policy_id)

# ipsec sa policy (policy_id) (gateway_id) (ah/esp) (esp_algo) (ah_algo)
例:# ipsec sa policy 06 24 esp des-cbc sha-hmac

③トンネルの設定

# tunnel select 2
# ipsec tunnel (policy_id)
# tunnel enable 2

IPの設定

○インターフェースにipアドレスを設定する

# ip [interface] address [ipaddress/mask] 
# ip [interface] address dhcp
# ip pp address [ipaddress/mask]
# ip [interface] secondary address [ipaddress/mask]
# ip [interface] secondary address dhcp

○ルーティングの設定

# ip route default gateway [address/pp/dhcp/tunnel] [metric/hide/weight] 
# ip route [net/mask] gateway [address/pp/dhcp/tunnel]

NATの設定

①NATディスクリプタの動作タイプの設定

# nat descriptor type [nat_descriptor 1..21474836] [nat/masquerade/nat-masquerade/none]

※IPアドレスの変換だけを「NAT」、ポートの変換も合わせて「masquerade」としている

②NAT処理のIPアドレスの設定

# nat descriptor address outer [nat_descriptor] [outer_ipaddress/ipcp/primary] 
# nat descriptor address inner [nat_descriptor] [inner_ipaddress/auto]

③静的NATの登録

# nat descriptor static [nat_descriptor] [id] [outer]=[inner] [count]

④静的IPマスカレードの登録

# nat descriptor masquerade static [nat_descriptor] [id] [inner_ip] [protocol] [[outer_port=]inner_port]

⑤インターフェースへNATディスクリプタを適用する

# ip [interface] nat descriptor [nat_dewscriptor_list 16こまで]
# ip pp nat descriptor [nat_dewscriptor_list 16こまで]
# ip tunnel nat descriptor [nat_dewscriptor_list 16こまで]

設定の保存とリストア

RTXの場合は、自分自身がTFTPサーバーとして振舞う
(考えようによってはいい奴である)

■RTXでのTFTPホストの設定

これはRTXの画面
> administrator
Password:******
# tftp host 172.16.0.32
# show tftp
アクセス許可:172.16.0.32
# save

以下、RTXは172.16.0.1、UNIXは172.16.0.32という設定で。

■TFTPホスト(UNIX)に、RTXの設定を保存する操作
最初に設定を保存するファイルをUNIX上に作っといてね。

これはUNIXのシェルの画面
$ tftp
tftp> connect 172.16.0.1 (←RTX)
tftp> mode ascii
tftp> get config/(administratorのpassword) ファイル名称
Received 768 bytes in o.1 seconds
tftp> quit
$

■TFTPホスト(UNIX)から、RTXに設定を書き込む操作

これはUNIXのシェルの画面
$ tftp
tftp> connect 172.16.0.1 (←RTX)
tftp> mode ascii
tftp> put ファイル名称 config/(administratorのpassword)
Sent 799 bytes in 0.1 seconds
tftp> quit
$

基本コマンド

○管理者モードに入るには?

 > administrator

○ヘルプ

# show command

○設定の表示

# show config
# show config pp [number]
# show environment

○状態の表示

# show arp
# show status [interface]
# show status pp [pp_num]
# show ip route
# show status pptp

○設定の保存

# save

○設定ファイルの一覧

# show config list

○設定の初期化

# cold start

○動的情報の初期化

# clear arp
# clear ip dynamic routing
# clear bridge learning
# clear log
# clear account pp [number]
# clear account [interface]
# clear dns cache

○ログインパスワードの設定

# login password

○管理者パスワードの設定

# administrator password

○ログインタイマの設定

# login timer 30..21474836
または
# login time clear
(telnetで入ったときはこれは有効にならない)

○タイムゾーンの設定

# timezone jst (これで日本時間)

○現在の日付と時刻の設定

# date yyyy-mm-dd
# time hh:mm:ss
# ntpdate [ntp-server]

○仮想インターフェースの操作

# pp enable [all / number]
# tunnel enable [all / number]
逆は # disable

# connect [pp_number]
# disconnect [pp_number]

○再起動

# restart

○インターフェースの再起動

# interface reset [interface]
# interface reset pp [number]