古河電工ネットワーク機器の総合ブランド ファイテルネット
古河電工
FITELnetトップ製品ラインナップイベント&セミナーセールス&サポート
Routing to the Future FITELnet
お問い合わせはこちら
 
設定例
5.IPsecインタフェース上でOSPFを使用する
概要
補足・注意点
設定データの例
設定項目 設定値 備考
センター拠点側 拠点側
LANインタフェースIPアドレス 172.16.0.1/24 172.17.0.1/24
loopbackインタフェースIPアドレス 1.1.1.1 2.2.2.2
IPsecインタフェースIPアドレス 100.0.0.1/24 100.0.0.2/24 サブネットを合わせる必要があります。
OSPFエリアに含まれる
ネットワーク範囲

1.1.1.1/32

2.2.2.2/32

100.0.0.0/24

100.0.0.0/24

コマンド設定の例
(!の行はコメントです。実際に入力する必要はありません。)
この設定を利用したい方は
センター拠点の設定
!
!
! 特権ユーザモードに移行します。
!
Router> enable
Enter password: super ←パスワードを入力します。(実際は表示されない)
!
Router#
!
!
! 基本設定モードに移行します。
!
Router# configure terminal
Router(config)#
!
!
Router(config)# hostname center
!
! デフォルトルートを設定します。
!
center(config)# ip route 0.0.0.0 0.0.0.0 pppoe 1
!
! PPPoE1 インターフェースを設定します。
!
center(config)# interface pppoe 1
center(config-if pppoe 1)#  ip address 100.100.100.100
center(config-if pppoe 1)#  pppoe server FLETS
center(config-if pppoe 1)#  pppoe account abc012@***.***.ne.jp xxxyyyzzz
center(config-if pppoe 1)#  pppoe type lan
center(config-if pppoe 1)# exit
!
!
! LAN側IPアドレスを設定します。
!
center(config)# interface lan 1
center(config-if lan 1)# ip address 172.16.0.1 255.255.255.0
center(config-if lan 1)# exit
!
!
! ループバックインタフェース設定モードに移行します。
!
center(config)# interface loopback 1
center(config-if loopback 1)# ip address 1.1.1.1
center(config-if loopback 1)# exit
!
!
! OSPFの設定をします。
!
center(config)# router ospf
center(config-ospf)# network 1.1.1.1 0.0.0.0 area 0
center(config-ospf)# network 100.0.0.0 0.0.0.255 area 0
center(config-ospf)# redistribute connected route-map PEER
center(config-ospf)# router-id 1.1.1.1
center(config-ospf)#exit
!
center(config)# route-map PEER permit 1
center(config-rmap PEER permit 1)# match ip address 10
center(config-rmap PEER permit 1)#exit
!
center(config)# access-list 10 permit 172.16.0.0 0.0.0.255
!
!
! VPNの設定をします。
!
center(config)# vpn enable
center(config)# vpnlog enable
!
center(config)# ipsec access-list 1 ipsec ip any any
center(config)# ipsec access-list 64 bypass ip any any
center(config)# ipsec transform-set NULL esp-null esp-sha-hmac
!
center(config)# interface ipsecif 1
center(config-if ipsecif 1)# crypto map MAP1
center(config-if ipsecif 1)# ip ospf network point-to-point *1
center(config-if ipsecif 1)# ip address 100.0.0.1 255.255.255.0
center(config-if ipsecif 1)# ip mtu 1500
center(config-if ipsecif 1)#exit
!
center(config)# crypto isakmp policy 1
center(config-isakmp)# authentication prekey
center(config-isakmp)# encryption aes 256
center(config-isakmp)# group 2
center(config-isakmp)# hash sha
center(config-isakmp)# key ascii fitelnet
center(config-isakmp)# lifetime 86400
center(config-isakmp)# negotiation-mode main
center(config-isakmp)# peer-identity address 200.200.200.200
center(config-isakmp)#exit
!
center(config)# crypto map MAP1 1
center(config-crypto-map)# match address 1
center(config-crypto-map)# set peer address 200.200.200.200
center(config-crypto-map)# set security-association lifetime seconds 28800
center(config-crypto-map)# set transform-set NULL
center(config-crypto-map)#exit
!
center(config)# end
!
!
! 設定を保存します。
!
center# save SIDE-A.cfg
% saving working-config
% finished saving

center#
!
!
! 設定を有効にするために再起動します。
!
center# reset 
Are you OK to cold start?(y/n) y
*1 OSPFインタフェースのネットワークの型によって以下の様に設定する必要があります。
    IPsecインタフェースを利用時は、point-to-pointタイプがデフォルトとなります。

    ・point-to-pointタイプ:ip ospf network point-to-point

    ・point-to-multipointタイプ :ip ospf network point-to-multipoint

    ・broadcastタイプ:ip ospf network broadcast

    ・non-broadcast multiple accessタイプ:ip ospf network non-broadcast
      ※non-broadcast multiple accessタイプの場合は、neighborを設定する必要があります。

        Router(config)# router ospf
        Router(config-ospf)# neighbor 100.0.0.2
        Router(config-ospf)#exit

コマンド設定の例
(!の行はコメントです。実際に入力する必要はありません。)
この設定を利用したい方は
拠点の設定
!
!
! 特権ユーザモードに移行します。
!
Router> enable
Enter password: super ←パスワードを入力します。(実際は表示されない)
!
Router#
!
!
! 基本設定モードに移行します。
!
Router# configure terminal
Router(config)#
!
!
Router(config)# hostname kyoten
!
! デフォルトルートを設定します。
!
kyoten(config)# ip route 0.0.0.0 0.0.0.0 pppoe 1
!
! PPPoE1 インターフェースを設定します。
!
kyoten(config)# interface pppoe 1
kyoten(config-if pppoe 1)#  ip address 200.200.200.200
kyoten(config-if pppoe 1)#  pppoe server FLETS
kyoten(config-if pppoe 1)#  pppoe account abc345@***.***.ne.jp zzzyyyxxx
kyoten(config-if pppoe 1)#  pppoe type lan
kyoten(config-if pppoe 1)# exit
!
!
! LAN側IPアドレスを設定します。
!
kyoten(config)# interface lan 1
kyoten(config-if lan 1)# ip address 172.17.0.1 255.255.255.0
kyoten(config-if lan 1)# exit
!
!
! ループバックインタフェース設定モードに移行します。
!
kyoten(config)# interface loopback 1
kyoten(config-if loopback 1)# ip address 2.2.2.2
kyoten(config-if loopback 1)# exit
!
!
! OSPFの設定をします。
!
kyoten(config)# router ospf
kyoten(config-ospf)# network 2.2.2.2 0.0.0.0 area 0
kyoten(config-ospf)# network 100.0.0.0 0.0.0.255 area 0
kyoten(config-ospf)# redistribute connected route-map PEER
kyoten(config-ospf)# router-id 2.2.2.2
kyoten(config-ospf)#exit
!
kyoten(config)# route-map PEER permit 1
kyoten(config-rmap PEER permit 1)# match ip address 10
kyoten(config-rmap PEER permit 1)#exit
!
kyoten(config)# access-list 10 permit 172.17.0.0 0.0.0.255
!
!
! VPNの設定をします。
!
kyoten(config)# vpn enable
kyoten(config)# vpnlog enable
!
kyoten(config)# ipsec access-list 1 ipsec ip any any
kyoten(config)# ipsec access-list 64 bypass ip any any
kyoten(config)# ipsec transform-set NULL esp-null esp-sha-hmac
!
kyoten(config)# interface ipsecif 1
kyoten(config-if ipsecif 1)# crypto map MAP1
kyoten(config-if ipsecif 1)# ip ospf network point-to-point *1
kyoten(config-if ipsecif 1)# ip address 100.0.0.2 255.255.255.0
kyoten(config-if ipsecif 1)# ip mtu 1500
kyoten(config-if ipsecif 1)#exit
!
kyoten(config)# crypto isakmp policy 1
kyoten(config-isakmp)# authentication prekey
kyoten(config-isakmp)# encryption aes 256
kyoten(config-isakmp)# group 2
kyoten(config-isakmp)# hash sha
kyoten(config-isakmp)# key ascii fitelnet
kyoten(config-isakmp)# lifetime 86400
kyoten(config-isakmp)# negotiation-mode main
kyoten(config-isakmp)# peer-identity address 100.100.100.100
kyoten(config-isakmp)#exit
!
kyoten(config)# crypto map MAP1 1
kyoten(config-crypto-map)# match address 1
kyoten(config-crypto-map)# set peer address 100.100.100.100
kyoten(config-crypto-map)# set security-association lifetime seconds 28800
kyoten(config-crypto-map)# set transform-set NULL
kyoten(config-crypto-map)#exit
!
kyoten(config)# end
!
!
! 設定を保存します。
!
kyoten# save SIDE-A.cfg
% saving working-config
% finished saving

kyoten#
!
!
! 設定を有効にするために再起動します。
!
kyoten# reset 
Are you OK to cold start?(y/n) y
*1 OSPFインタフェースのネットワークの型によって以下の様に設定する必要があります。
    IPsecインタフェースを利用時は、point-to-pointタイプがデフォルトとなります。

    ・point-to-pointタイプ:ip ospf network point-to-point

    ・point-to-multipointタイプ :ip ospf network point-to-multipoint

    ・broadcastタイプ:ip ospf network broadcast

    ・non-broadcast multiple accessタイプ:ip ospf network non-broadcast
      ※non-broadcast multiple accessタイプの場合は、neighborを設定する必要があります。

        Router(config)# router ospf
        Router(config-ospf)# neighbor 100.0.0.2
        Router(config-ospf)#exit

ページトップへ

All Rights Reserved, Copyright(C) FURUKAWA ELECTRIC CO., LTD. 2010