2012年1月10日火曜日

MPLS VPN lab(スタティックルーティング版)


MPLS VPN(スタティックルート版ラボ)




■ 目的

(1) MPLSネットワーク内を経由してAAAA株式会社の本社、支店同士で通信が出来るようにする事。
(2) MPLSネットワーク内を経由してBBBB株式会社の本社、支店同士で通信が出来るようにする事。
(3) AAAA株式会社とBBBB株式会社間は一切通信できない事。(ルーティング情報も含めて)


■ 設定コンフィグ

※ 基礎コマンドは除く


(1)R1(AAAA株式会社本社側CEルータ)

R1(config)# ip route 0.0.0.0 0.0.0.0 10.10.0.2


(2)R2(通信事業者MPLSネットワーク本社側PEルータ)


Router2(config)# ip cef
Router2(config)# ip vrf AAAA
Router2(config-vrf)# rd 1:100
Router2(config-vrf)# route-target both 1:100 
Router2(config-vrf)# exit
Router2(config)# interface ser0/0
Router2(config-if)# ip address 10.0.0.1 255.255.255.252
Router2(config-if)# mpls ip
Router2(config-if)# no shutdown
Router2(config)# interface ser0/1
Router2(config-if)# ip vrf forwarding AAAA
Router2(config-if)# ip address 10.10.0.2 255.255.255.252
Router2(config-if)# no shutdown
Router2(config)# interface loopback 0
Router2(config-if)# ip address 1.1.1.1 255.255.255.255
Router2(config-if)# no shutdown
Router2(config-if)# exit
Router2(config)# router bgp 100
Router2(config-router)# no bgp default ipv4-unicast
Router2(config-router)# neighbor 2.2.2.2 remote-as 100
Router2(config-router)# neighbor 2.2.2.2 update-source Loopback0
Router2(config-router)# address-family vpnv4
Router2(config-router-af)# neighbor 2.2.2.2 activate 
Router2(config)# ip route vrf AAAA 10.10.10.10 255.255.255.255 10.10.0.1
Router2(config)#router bgp 100
Router2(config-router)#address-family ipv4 vrf AAAA 
Router2(config-router-af)#redistribute static

Router2(config)# ip vrf BBBB
Router2(config-vrf)# rd 1:200
Router2(config-vrf)# route-target both 1:200 
Router2(config-vrf)# exit
Router2(config)# interface fa0/1
Router2(config-if)# ip vrf forwarding BBBB
Router2(config-if)# ip address 10.100.0.2 255.255.255.252
Router2(config-if)# no shutdown
Router2(config)# ip route vrf BBBB 100.100.100.100 255.255.255.255 10.100.0.1
Router2(config)#router bgp 100
Router2(config-router)#address-family ipv4 vrf BBBB 
Router2(config-router-af)#redistribute static

(3)R3(通信事業者MPLSネットワークPルータ)

Router3(config)# ip cef
Router3(config)# interface ser0/0
Router3(config-if)# ip address 10.0.0.2 255.255.255.252
Router3(config-if)# mpls ip
Router3(config-if)# no shut
Router3(config-if)# exit
Router3(config)# interface ser0/1
Router3(config-if)# ip address 10.0.0.6 255.255.255.252
Router3(config-if)# mpls ip
Router3(config-if)# no shut

(4)R4(通信事業者MPLSネットワーク支社側PEルータ)

Router4(config)# ip cef
Router4(config)# ip vrf AAAA
Router4(config-vrf)# rd 1:100
Router4(config-vrf)# route-target both 1:100 
Router4(config-vrf)# exit
Router4(config)# interface ser0/0
Router4(config-if)# ip address 10.0.0.5 255.255.255.252
Router4(config-if)# mpls ip
Router4(config-if)# no shutdown
Router4(config)# interface ser0/1
Router4(config-if)# ip vrf forwarding AAAA
Router4(config-if)# ip address 10.20.0.2 255.255.255.252
Router4(config-if)# no shutdown
Router4(config)# interface loopback 0
Router4(config-if)# ip address 2.2.2.2 255.255.255.255
Router4(config-if)# no shutdown
Router4(config-if)# exit
Router4(config)# router bgp 100
Router4(config-router)# no bgp default ipv4-unicast
Router4(config-router)# neighbor 1.1.1.1 remote-as 100
Router4(config-router)# neighbor 1.1.1.1 update-source Loopback0
Router4(config-router)# address-family vpnv4
Router4(config-router-af)# neighbor 1.1.1.1 activate 
Router4(config)# ip route vrf AAAA 20.20.20.20 255.255.255.255 10.20.0.1
Router4(config)#router bgp 1
Router4(config-router)#address-family ipv4 vrf AAAA 
Router4(config-router-af)#redistribute static

Router4(config)# ip vrf BBBB
Router4(config-vrf)# rd 1:200
Router4(config-vrf)# route-target both 1:200 
Router4(config-vrf)# exit
Router4(config)# interface fa0/1
Router4(config-if)# ip vrf forwarding BBBB
Router4(config-if)# ip address 10.110.0.2 255.255.255.252
Router4(config-if)# no shutdown
Router4(config)# ip route vrf BBBB 110.110.110.110 255.255.255.255 10.110.0.1
Router4(config)#router bgp 100
Router4(config-router)#address-family ipv4 vrf BBBB 
Router4(config-router-af)#redistribute static


(5)R5(AAAA株式会社支店側CEルータ)

R5(config)# ip route 0.0.0.0 0.0.0.0 10.20.0.2

(6)R6(AAAA株式会社支店側CEルータ)

R6(config)# ip route 0.0.0.0 0.0.0.0 10.100.0.2

(7)R7(AAAA株式会社支店側CEルータ)

R7(config)# ip route 0.0.0.0 0.0.0.0 10.110.0.2



■ 検証コマンド

1.ルーティングテーブルの確認

(1)R2(通信事業者MPLSネットワーク本社側PEルータ)


Router2# show ip route vrf AAAA

Routing Table: AAAA
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

     20.0.0.0/32 is subnetted, 1 subnets
B       20.20.20.20 [200/0] via 2.2.2.2, 01:13:35
     10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
S       10.10.10.10/32 [1/0] via 10.10.0.1
C       10.10.0.0/30 is directly connected, Serial0/1


Router2# show ip route vrf BBBB

Routing Table: BBBB
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

     100.0.0.0/32 is subnetted, 1 subnets
S       100.100.100.100 [1/0] via 10.100.0.1
     110.0.0.0/32 is subnetted, 1 subnets
B       110.110.110.110 [200/0] via 2.2.2.2, 01:07:13
     10.0.0.0/30 is subnetted, 1 subnets
C       10.100.0.0 is directly connected, FastEthernet0/0


(2)R4(通信事業者MPLSネットワーク支社側PEルータ)

Router4#show ip route vrf AAAA

Routing Table: AAAA
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

     20.0.0.0/32 is subnetted, 1 subnets
S       20.20.20.20 [1/0] via 10.20.0.1
     10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
B       10.10.10.10/32 [200/0] via 1.1.1.1, 01:19:09
C       10.20.0.0/30 is directly connected, Serial0/1

Router4#show ip route vrf BBBB

Routing Table: BBBB
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

     100.0.0.0/32 is subnetted, 1 subnets
B       100.100.100.100 [200/0] via 1.1.1.1, 01:17:36
     110.0.0.0/32 is subnetted, 1 subnets
S       110.110.110.110 [1/0] via 10.110.0.1
     10.0.0.0/30 is subnetted, 1 subnets
C       10.110.0.0 is directly connected, FastEthernet0/0


2.BGPテーブルの確認


(1)R2(通信事業者MPLSネットワーク本社側PEルータ)

Router2#show ip bgp vpnv4 vrf AAAA
BGP table version is 9, local router ID is 1.1.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
Route Distinguisher: 1:100 (default for vrf AAAA)
*> 10.10.10.10/32   10.10.0.1                0         32768 ?
*>i20.20.20.20/32   2.2.2.2                  0    100      0 ?


Router2#show ip bgp vpnv4 vrf BBBB
BGP table version is 9, local router ID is 1.1.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
Route Distinguisher: 1:200 (default for vrf BBBB)
*> 100.100.100.100/32
                    10.100.0.1               0         32768 ?
*>i110.110.110.110/32
                    2.2.2.2                  0    100      0 ?


(2)R4(通信事業者MPLSネットワーク支社側PEルータ)

Router4#show ip bgp vpnv4 vrf AAAA
BGP table version is 9, local router ID is 2.2.2.2
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
Route Distinguisher: 1:100 (default for vrf AAAA)
*>i10.10.10.10/32   1.1.1.1                  0    100      0 ?
*> 20.20.20.20/32   10.20.0.1                0         32768 ?

Router4#show ip bgp vpnv4 vrf BBBB
BGP table version is 9, local router ID is 2.2.2.2
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
Route Distinguisher: 1:200 (default for vrf BBBB)
*>i100.100.100.100/32
                    1.1.1.1                  0    100      0 ?
*> 110.110.110.110/32
                    10.110.0.1               0         32768 ?


3.拠点間で疎通確認

(1)R1(AAAA株式会社本社側CEルータ)

Router1#ping 20.20.20.20 source 10.10.10.10

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 20.20.20.20, timeout is 2 seconds:
Packet sent with a source address of 10.10.10.10
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 44/88/132 ms

Router1#ping 100.100.100.100 source 10.10.10.10

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 100.100.100.100, timeout is 2 seconds:
Packet sent with a source address of 10.10.10.10
U.U.U
Success rate is 0 percent (0/5)
Router1#ping 110.110.110.110 source 10.10.10.10

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 110.110.110.110, timeout is 2 seconds:
Packet sent with a source address of 10.10.10.10
U.U.U
Success rate is 0 percent (0/5)



(2)R5(AAAA株式会社支店側CEルータ)

Router5#ping 10.10.10.10 source 20.20.20.20

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.10.10.10, timeout is 2 seconds:
Packet sent with a source address of 20.20.20.20
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 120/139/164 ms

Router5#ping 100.100.100.100 source 20.20.20.20

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 100.100.100.100, timeout is 2 seconds:
Packet sent with a source address of 20.20.20.20
U.U.U
Success rate is 0 percent (0/5)

Router5#ping 110.110.110.110 source 20.20.20.20

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 110.110.110.110, timeout is 2 seconds:
Packet sent with a source address of 20.20.20.20
U.U.U
Success rate is 0 percent (0/5)

(3)R6(AAAA株式会社支店側CEルータ)

Router6#ping 110.110.110.110 source 100.100.100.100

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 110.110.110.110, timeout is 2 seconds:
Packet sent with a source address of 100.100.100.100
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 56/93/200 ms

Router6#ping 10.10.10.10 source 100.100.100.100

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.10.10.10, timeout is 2 seconds:
Packet sent with a source address of 100.100.100.100
U.U.U
Success rate is 0 percent (0/5)

Router6#ping 20.20.20.20 source 100.100.100.100

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 20.20.20.20, timeout is 2 seconds:
Packet sent with a source address of 100.100.100.100
U.U.U
Success rate is 0 percent (0/5)

(4)R7(AAAA株式会社支店側CEルータ)


Router7#ping 100.100.100.100 source 110.110.110.110

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 100.100.100.100, timeout is 2 seconds:
Packet sent with a source address of 110.110.110.110
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 64/116/200 ms

Router7#ping 10.10.10.10 source 110.110.110.110

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.10.10.10, timeout is 2 seconds:
Packet sent with a source address of 110.110.110.110
U.U.U
Success rate is 0 percent (0/5)

Router7#ping 20.20.20.20 source 110.110.110.110

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 20.20.20.20, timeout is 2 seconds:
Packet sent with a source address of 110.110.110.110
U.U.U
Success rate is 0 percent (0/5)

※ 解説は後ほど搭載します!!

2012年1月7日土曜日

プライベートVLANと保護ポート



プライベートVLAN(Private VLAN)と保護ポート


プライベートVLANとは、

VLANの中に複数のVLANを作る技術の事です。
プライベートVLANによって区切られたプライベートVLAN内でブロードキャストドメインを分割する事が出来ます。
又、従来では同一VALN間でトラフィック制御する際ACLなどを使用して制御が複雑になるなどの問題点がありましたが、プライベートVLANはその欠点を解消しております。





保護ポートとは、

保護ポートとは、プライベートVLANに比べてセカンダリVLANを設定せずにVLANのトラフィック制御をする事が出来る技術の事です。
保護ポートを設定したインターフェース同士は通信する事が出来ませんが、その他のポートとは通信する事が可能です。

■ 保護ポートの基本設定

Switch(config)# interface { インターフェース名 }
Switch(config-if)# switchport access vlan { VLAN番号 }
Switch(config-if)# switchport mode access
Switch(config-if)# switchport protected //保護ポートの設定

保護ポートの設定はとても簡単ですが、細かくトラフィック制御する事が出来ません。








■ プライベートVLANの用語



プライマリVLAN ・・・VLANドメイン全体の事。(従来通りのVLANの解釈)
セカンダリVLAN ・・・プライマリVLANに作成するVLANの事。セカンダリVLANは、独立VLANとコミュニティVLANに分類できます。
独立VLAN      ・・・プライマリVLAN内とのみ通信可能なVLANの事。同じセカンダリーVLAN同士も通信する事は出来ません。
コミュニティVLAN・・・同じコミュニティVLANとプライマリVLAN内とのみ通信可能なVLANの事。



■ 基本設定


①VTPをトランスペアレントモードにする

Switch(config)#vtp mode transparent

②プライマリVLANとセカンダリVLANの設定

Switch(config)# vlan { 作成するVLAN番号 }
Switch(config-vlan)#private-vlan { primary | isolated | community }


[ private-vlanのパラメータの詳細 ]
(1) プライマリVLAN

primary ・・・プライマリVLANの設定

例>
Switch(config)# vlan 50
Switch(config-vlan)# private-vlan primary 
Switch(config-vlan)# private-vlan association { セカンダリVLAN番号 }
※既にプライマリVLANの定義が終わっている場合は、以下のコマンドセカンダリVLANの追加、削除が可能。
Switch(config-vlan)# private-vlan association  [ add | remove ]  { セカンダリVLAN番号 }


(2) セカンダリVLAN

 ・ isolated(隔離モード) ・・・プライマリVLANと通信する事は出来るがセカンダリVLANを含むその他のVLANと通信する事は出来ない。
 ・ community(コミュニティモード) ・・・同じコミュニティとプライマリVLANとは通信する事が出来るが、その他のセカンダリVLANとは通信できない。


③各インターフェースの設定

(1) プライマリVLANの設定

Switch(config)# interface { インターフェース名 }
Switch(config-if)# switchport mode private-vlan primiscuous
Switch(config-if)# switchport private-vlan mapping { プライマリVLAN } [ add | remove ] {セカンダリVLAN}  //プライマリVLANとセカンダリVLANのマッピング




(2) セカンダリVLAN(独立VLAN、コミュニティVLAN)の設定

Switch(config)# interface { インターフェース名 }
Switch(config-if)# switchport mode private-vlan host
Switch(config-if)# switchport private-vlan host-association { プライマリVLAN } {セカンダリVLAN}   //プライマリVLANとセカンダリVLANの関連付け



■ プライベートVLANの設定例

(1) プライマリVLANの設定

Switch(config)#vtp mode transparent
Switch(config)# vlan 50
Switch(config-vlan)# private-vlan primary 
Switch(config-vlan)# private-vlan association 5,10,15
Switch(config-vlan)# exit
Switch(config)# vlan 5
Switch(config-vlan)#private-vlan isolated
Switch(config-vlan)# exit
Switch(config)# vlan 10
Switch(config-vlan)#private-vlan community
Switch(config-vlan)# exit
Switch(config)# vlan 15
Switch(config-vlan)#private-vlan community
Switch(config-vlan)# exit
Switch(config)# interface fa0/24
Switch(config-if)# switchport mode private-vlan primiscuous
Switch(config-if)# switchport private-vlan mapping 50 5,10,15
Switch(config-if)# exit
Switch(config)# interface fa0/1
Switch(config-if)# switchport mode private-vlan host
Switch(config-if)# switchport private-vlan host-association 50 5
Switch(config-if)# exit
Switch(config)# interface fa0/3
Switch(config-if)# switchport mode private-vlan host
Switch(config-if)# switchport private-vlan host-association 50 10
Switch(config-if)# exit
Switch(config)# interface fa0/5
Switch(config-if)# switchport mode private-vlan host
Switch(config-if)# switchport private-vlan host-association 50 15
Switch(config-if)# exit




2012年1月4日水曜日

VRRPの設定


VRRP ( Virtual Router Redundancy Protocol )


VRRPとは、

標準化されている冗長化プロトコルです。cisco独自ではない為、ciscoルータにも互換性があります。
1つのデフォルトゲートウェイのIPアドレスとMACアドレスを複数のルータで共有する事によって冗長化する事が出来ます。

用語

マスタールータ・・・仮想IPアドレスの代表としてルーティングするルータ。
バックアップルータ・・・アクティブルータがダウンした時に、アクティブルータの機能を受け継ぐルータ。
仮想IPアドレス・・・・複数のルータで共有する仮想IPアドレス
仮想MACアドレス ・・・複数のルータで共有する仮想MACアドレス。デフォルトは、[ 0000.005e.01?? ]
※ ??はVRRPグループ番号が入る。
VRRPプライオリティ・・優先度を決める数字。デフォルトで100が設定されている。高い値を持つルータがアクティブルータに選出される。
VRRPグループ・・・・・VRRPに参加する為のグループナンバー(バージョン1では[255]まで、バージョン2では[4095]まで指定可能。)




■ VRRP 基本設定



① 仮想IPアドレスの設定

Router(config)# int fa0/0
Router(config-if)# shutdown //強制ではない。
Router(config-if)# vrrp { グループナンバー } ip { IPアドレス } [secondary]
※上記のコマンドを設定する際は、事前にshutdownして下さい。

② プライオリティ設定

Router(config-if)# vrrp { グループナンバー } prirority { 優先値(プライオリティ値) }
※プライオリティ値のデフォルト設定は、100です。


③アクティブルータのインターフェースダウン時の切り替え設定

Router(config-if)#  track { オブジェクト番号 } interface { インターフェース名 } [ line-protocol | ip routing ] 
Router(config-if)# grrp { グループナンバー } track { オブジェクト番号 } decrement { 減少させるプライオリティ値 }

※VRRPでは、デフォルトでプリエンプトが有効になっております。しかし、プリエンプトの詳細設定をしたい時は以下のコマンドで可能です。

Router(config-if)# vrrp group preempt [ マスタールータへの切り替え時間(秒) ]


■設定例

①マスタールータの設定

VRRP1(config)# track 5 interface FastEthernet0/1 line-protocol
VRRP1(config)# interface FastEthernet0/0
VRRP1(config-if)# ip address 192.168.1.9 255.255.255.240
VRRP1(config-if)# vrrp 5 ip 192.168.1.14
VRRP1(config-if)# vrrp 5 priority 150
VRRP1(config-if)# vrrp 5 track 5 decrement 30
VRRP1(config-if)# no shutdown

②バックアップルータの設定

VRRP2(config)# interface FastEthernet0/0
VRRP2(config-if)# ip address 192.168.1.11 255.255.255.240
VRRP2(config-if)# vrrp 5 ip 192.168.1.14
VRRP2(config-if)# vrrp 5 priority 130
※fastethernet0/1がダウンした場合、プライオリティ値を20下げる(ダウン時、プライオリティ値は、130になりスタンバイルータに引き継ぐ)。
VRRP2(config-if)# no shutdown


③検証

1.show standyコマンド

(1)VRRP1側(マスター側)

VRRP1#show vrrp
FastEthernet0/0 - Group 5
  State is Master
  Virtual IP address is 192.168.1.14
  Virtual MAC address is 0000.5e00.0105
  Advertisement interval is 1.000 sec
  Preemption enabled
  Priority is 150
    Track object 5 state Up decrement 30
  Master Router is 192.168.1.10 (local), priority is 150
  Master Advertisement interval is 1.000 sec
  Master Down interval is 3.414 sec


(2)VRRP2側(バックアップルータ側)

VRRP2#show vrrp
FastEthernet0/0 - Group 5
  State is Backup
  Virtual IP address is 192.168.1.14
  Virtual MAC address is 0000.5e00.0105
  Advertisement interval is 1.000 sec
  Preemption enabled
  Priority is 130
  Master Router is 192.168.1.10, priority is 150
  Master Advertisement interval is 1.000 sec
  Master Down interval is 3.492 sec (expires in 3.376 sec)


2.VRRP1のinterface fastethernet0/1をダウン

VRRP1(config)# interface fastethernet0/1
VRRP1(config-if)# shutdown


(1)VRRP1側(バックアップルータ側)

*Mar  1 01:00:44.575: %VRRP-6-STATECHANGE: Fa0/0 Grp 5 state Master -> Backup

VRRP1のinterface fastethernet0/1がダウンした為、バックアップステートからマスターへ


(2)VRRP2側(バックアップルータ側)

*Mar  1 01:00:56.875: %VRRP-6-STATECHANGE: Fa0/0 Grp 5 state Backup -> Master

VRRP1のinterface fastethernet0/1がダウンした為、バックアップステートからマスターへ




3.show standyコマンド

(1)VRRP1側(マスタールータ→スタンバイルータ側)

VRRP1#show vrrp

FastEthernet0/0 - Group 5
  State is Backup
  Virtual IP address is 192.168.1.14
  Virtual MAC address is 0000.5e00.0105
  Advertisement interval is 1.000 sec
  Preemption enabled
  Priority is 120 (cfgd 150)                       //interface fa0/1がダウンした為、プライオリティが30ダウンし120になる。
    Track object 5 state Down decrement 30
  Master Router is 192.168.1.11, priority is 130
  Master Advertisement interval is 1.000 sec
  Master Down interval is 3.414 sec (expires in 3.042 sec)

(2)VRRP2側(スタンバイルータ→マスタールータ側)

VRRP2#show vrrp
FastEthernet0/0 - Group 5
  State is Master
  Virtual IP address is 192.168.1.14
  Virtual MAC address is 0000.5e00.0105
  Advertisement interval is 1.000 sec
  Preemption enabled
  Priority is 130
  Master Router is 192.168.1.11 (local), priority is 130
  Master Advertisement interval is 1.000 sec
  Master Down interval is 3.492 sec



4.RouterBのinterface fastethernet0/1をアップさせる

(1)VRRP1側(バックアップルータ→マスタールータ側)

*Mar  1 01:02:31.595: %VRRP-6-STATECHANGE: Fa0/0 Grp 5 state Backup -> Master

VRRP1のインターフェースがアップした為、プライオリティ値が150に戻り再びマスタールータへ戻る

(2)VRRP2側(マスタールータ→バックアップルータ側)

*Mar  1 01:02:44.115: %VRRP-6-STATECHANGE: Fa0/0 Grp 5 state Master -> Backup

VRRP1のインターフェースがアップした為、VRRP1のプライオリティ値が150に戻り自身は再びバックアップルータへ戻る

2012年1月3日火曜日

HSRPの設定

HSRP(Hot Standby Routing Protocol)とは

cisco独自の冗長化プロトコルです。1つのデフォルトゲートウェイのIPアドレスとMACアドレスを複数のルータで共有する事によって冗長化する事が出来ます。

>>オススメ記事:冗長化プロトコル(HSRP)の仕様・設定方法を図解解説
>>オススメ記事:HSRPのインターフェーストラッキングの必要性・設定方法を解説

用語


  • アクティブルータ・・・仮想IPアドレスの代表としてルーティングするルータ。
  • スタンバイルータ・・・アクティブルータがダウンした時に、アクティブルータの機能を受け継ぐルータ。
  • 仮想IPアドレス・・・・複数のルータで共有する仮想IPアドレス
  • 仮想MACアドレス ・・・複数のルータで共有する仮想MACアドレス。デフォルトは、[ 0000.0c07.ac?? ]※ ??はHSRPグループ番号が入る。

  • HSRPプライオリティ・・優先度を決める数字。デフォルトで100が設定されている。高い値を持つルータがアクティブルータに選出される。
  • HSRPグループ・・・・・HSRPに参加する為のグループナンバー(バージョン1では[255]まで、バージョン2では[4095]まで指定可能。)


■ HSRP 基本設定


① 仮想IPアドレスの設定


Router(config)# int fa0/0
Router(config-if)# shutdown //強制ではない。
Router(config-if)# standby { グループナンバー } ip { 仮想IPアドレス [secondary] }
※上記のコマンドを設定する際は、事前にshutdownして下さい。

② プライオリティ設定


Router(config-if)# standby { グループナンバー } prirority { 優先値(プライオリティ値) }
※プライオリティ値のデフォルト設定は、100です。

③ プリエンプト設定


Router(config-if)# standby { グループナンバー } preempt[ delay [ minimum seconds | reload seconds | sync seconds ]

※ デフォルトの設定では、切り替え機能が備わっていません。

④アクティブルータのインターフェースダウン時の切り替え設定


Router(config-if)# standby { グループナンバー } track { インターフェース } { 減少させるプライオリティ値 }


■設定例

①スタンバイルータの設定


RouterA(config)# interface FastEthernet0/0
RouterA(config-if)# ip address 192.168.1.9 255.255.255.240
RouterA(config-if)# standby 5 ip 192.168.1.14
RouterB(config-if)# standby 5 priority 140
RouterA(config-if)# standby 5 preempt
RouterA(config-if)# no shutdown

②アクティブルータの設定


RouterB(config)# interface FastEthernet0/0
RouterB(config-if)# ip address 192.168.1.11 255.255.255.240
RouterB(config-if)# standby 5 ip 192.168.1.14
RouterB(config-if)# standby 5 priority 150
RouterB(config-if)# standby 5 preempt
RouterB(config-if)# standby 5 track FastEthernet0/1 20
※fastethernet0/1がダウンした場合、プライオリティ値を20下げる(ダウン時、プライオリティ値は、130になりスタンバイルータに引き継ぐ)。
RouterB(config-if)# no shutdown


③検証



1.show standyコマンド



(1)RouterA側(スタンバイルータ側)

RouterA#show standby
FastEthernet0/0 - Group 5
  State is Standby
    4 state changes, last state change 00:56:48
  Virtual IP address is 192.168.1.14
  Active virtual MAC address is 0000.0c07.ac05
    Local virtual MAC address is 0000.0c07.ac05 (v1 default)
  Hello time 3 sec, hold time 10 sec
    Next hello sent in 2.288 secs
  Preemption enabled
  Active router is 192.168.1.11, priority 150 (expires in 8.444 sec)
  Standby router is local
  Priority 140
  IP redundancy name is "hsrp-Fa0/0-5" (default)


(2)RouterB側(アクティブルータ側)


RouterB#show standby
FastEthernet0/0 - Group 5
  State is Active
    5 state changes, last state change 00:58:24
  Virtual IP address is 192.168.1.14
  Active virtual MAC address is 0000.0c07.ac05
    Local virtual MAC address is 0000.0c07.ac05 (v1 default)
  Hello time 3 sec, hold time 10 sec
    Next hello sent in 2.392 secs
  Preemption enabled
  Active router is local
  Standby router is 192.168.1.9, priority 140 (expires in 7.292 sec)
  Priority 150 
    Track interface FastEthernet0/1 state Up decrement 20
  IP redundancy name is "hsrp-Fa0/0-5" (default)

2.RouterBのinterface fastethernet0/1をダウン


RouterB(config)# interface fastethernet0/1
RouterB(config-if)# shutdown

(1)RouterA側(スタンバイルータ側)



*Mar  1 01:23:37.243: %HSRP-5-STATECHANGE: FastEthernet0/0 Grp 5 state Standby -> Active

スタンバイルータからアクティブルータへ


(2)RouterB側(アクティブルータ側)



*Mar  1 01:23:46.547: %HSRP-5-STATECHANGE: FastEthernet0/0 Grp 5 state Active -> Speak
*Mar  1 01:23:56.547: %HSRP-5-STATECHANGE: FastEthernet0/0 Grp 5 state Speak -> Standby

アクティブステートからスピーク→スタンバイルータへ



3.show standyコマンド


(1)RouterA側(スタンバイルータ→アクティブルータ側)


RouterA#show standby
FastEthernet0/0 - Group 5
  State is Active      //アクティブルータへ
    5 state changes, last state change 00:09:15
  Virtual IP address is 192.168.1.14
  Active virtual MAC address is 0000.0c07.ac05
    Local virtual MAC address is 0000.0c07.ac05 (v1 default)
  Hello time 3 sec, hold time 10 sec
    Next hello sent in 2.696 secs
  Preemption enabled
  Active router is local
  Standby router is 192.168.1.11, priority 130 (expires in 7.652 sec)     //interface fa0/1がダウンした為、プライオリティ値が20減少
  Priority 140 
  IP redundancy name is "hsrp-Fa0/0-5" (default)

(2)RouterB側(アクティブルータ→スタンバイルータ側)


RouterB#show standby
FastEthernet0/0 - Group 5
  State is Standby   //スタンバイルータへ
    7 state changes, last state change 00:11:44
  Virtual IP address is 192.168.1.14
  Active virtual MAC address is 0000.0c07.ac05
    Local virtual MAC address is 0000.0c07.ac05 (v1 default)
  Hello time 3 sec, hold time 10 sec
    Next hello sent in 0.120 secs
  Preemption enabled
  Active router is 192.168.1.9, priority 140 (expires in 9.124 sec)
  Standby router is local
  Priority 130 (configured 150)      //interface fa0/1がダウンした為、プライオリティ値が20減少
    Track interface FastEthernet0/1 state Down decrement 20
  IP redundancy name is "hsrp-Fa0/0-5" (default)



4.RouterBのinterface fastethernet0/1をアップさせる


(1)RouterA側(スタンバイルータ→アクティブルータ側)


*Mar  1 01:40:19.503: %HSRP-5-STATECHANGE: FastEthernet0/0 Grp 5 state Active -> Speak
HSRP1#
*Mar  1 01:40:29.503: %HSRP-5-STATECHANGE: FastEthernet0/0 Grp 5 state Speak -> Standby

RouterBのインターフェースがアップした為、プライオリティ値が150に戻り再びスタンバイルータへ戻る

(2)RouterB側(アクティブルータ→スタンバイルータ側)


*Mar  1 01:40:28.595: %HSRP-5-STATECHANGE: FastEthernet0/0 Grp 5 state Standby -> Active

RouterBのインターフェースがアップした為、プライオリティ値が150に戻り再びアクティブルータへ戻る


>>オススメ記事:CCIEが語る!ネットワークエンジニアにオススメな本・参考書!
>>オススメ記事:ITエンジニア必見!失敗しない転職エージェントの選び方はこれだ!

2011年12月4日日曜日

IPv6 2.IPv6ルーティングプロトコル


IPv6②

・ EUI-64について

EUI-64とは、
MACアドレスを利用して、デバイスに一意に識別するインターフェースIDを自動生成する機能の事。


例> ネットワークアドレス 2000::/64   PCのMACアドレス 00:17:42:09:B9:38 

1.PCのMACアドレスを先頭24ビット(ベンダーID)と後半24ビット(シリアル番号)に分ける。

ベンダーID : 00:17:42
シリアルID : 09:B9:38

2.ベンダーIDの先頭7ビット目をビット変換する。

ベンダーID : 00:17:42 → 02:17:42

3.ベンダーIDとシリアルIDの間に 「 FF:FE 」を追加する。

00:17:42 + FF:FE + 09:B9:38
インターフェースID : 00:17:42:FF:FE:09:B9:38

4.ネットワークアドレスを追加する。

EUI-64のIPv6アドレス体系 : 2000::00:17:42:FF:FE:09:B9:38/64




・ IPv6ルーティングプロトコル

IPv6のルーティングプロトコルは、IPv4のルーティングプロトコルを基に設計されています。
例えば、RIPは、RIPngにOSPFはOSPFv3になります。

・ RIPng(RIP next generation)

RIPngでは、IPv4のRIPv2の機能を基に作られております。

■ 特徴
・ディスタンスベクター型ルーティングプロトコル
・メトリックは、ホップ数。最大値は15。
・スプリットホライズンやポリズンリバースによるループ回避
・30秒ごとにマルチキャストアドレスを使用して、情報(ネクストホップ、リンクローカルアドレスなど)をアドバタイズする。(FF02::9) 


■ 基本設定

①ルーティングプロセスを有効にする。

Router(config)# ipv6 unicast-routing
Router(config)# ipv6 router rip { 識別子 }



②インターフェースでRIPngを有効にする。


Router(config)# interface fastethernet 0/0
Router(config-if)# ipv6 enable
Router(config-if)# ipv6 rip { 識別子 } enable



③IPv6アドレスの設定


Router(config-if)# ipv6 address { IPv6アドレス } 



・ OSPFv3

RIPngでは、IPv4のOSPFv2の機能を基に作られて居るためOSPFv2と特徴がたいだい同じです。

■ 特徴
・OSPFv2の基本的な特徴
・手動でルータIDを設定する。
・ネクストホップアドレスが、リンクローカルドレスになる。


■ 基本設定

①ルーティングプロセスを有効にする。

Router(config)# ipv6 unicast-routing
Router(config)# ipv6 router ospf { プロセス番号 }
Router(config-rtr)# router-id { ルータID(32ビット) }


②インターフェースでOSPFv3を有効にする。

Router(config)# interface fastethernet 0/0
Router(config-if)# ipv6 enable
Router(config-if)# ipv6 ospf { プロセス番号 } area { エリア番号 }


③IPv6アドレスの設定

Router(config-if)# ipv6 address { IPv6アドレス } 



2011年12月2日金曜日

IPv6 1.IPv6のアドレス構成

IPv6①

・IPv6とは、


IPv4アドレスの枯渇を解決する為に開発されたIPプロトコルです。

■ 特徴
①広大なアドレス空間  
IPv6では3.4 x 1038のアドレスが使用できます。それにより,多くのデバイスにグローバルIPアドレスを割り振ることができるようになる。
  柔軟なアドレス集約や,NATなしでのエンド間接続をサポートが可能。

②シンプルなヘッダ
  ルーティングの際の効率が上がる。

③セキュリティやモバイルの対応
  モバイルIPとIpsecを使用する事が可能。

④IPv4からIPv6への変換方法を複数使用する事が可能

など!!


・IPv6アドレスの種類


① ユニキャスト
通常の1 対 1の通信に使われるアドレス。グローバルユニキャスト(グローバル集約)とリンクローカル、ユニークローカルアドレスの3つのアドレスがある。

② エニーキャスト
IPv6からの新しいアドレスタイプで,異なるインタフェースに同一のアドレスを割り振ることができる。エニーキャストあてで送信すると最も近いインタフェースが受信します。負荷分散などで使用することができる。

③ マルチキャスト
異なるインタフェースに同一のアドレスを割り振り,マルチキャストアドレスあてに送信すると,そのすべてのインタフェースが受信します。IPv4のマルチキャストと同等です。



※IPv4で存在したブロードキャストアドレスはなくなっており,マルチキャスト,またはエニーキャストがその代替として使われます。





① ユニキャスト

1.グローバルユニキャストアドレス (::/128)

IPv4のグローバルユニキャストアドレスと同等の,インターネットで一意に管理されるアドレス
IPv6のアドレス空間のうち,2000::/3(先頭3ビットが「001」)からE000::/3(先頭3ビットが「111」)までを使用します。

※FF00::/8(先頭8ビットが「1111 1111」)はマルチキャストアドレスのため除きます。::1/128はループバックアドレス


2.リンクローカルユニキャストアドレス (fe80::/10)

ローカルのリンク(ルータを超えない)に範囲(スコープ)が限定されている。そして,リンクローカルアドレスはFE80::/10を使用してIPv6インタフェースに動的に設定されます。
リンクローカルアドレスは,自動設定,ネイバの発見,ルータの発見,ルーティングプロトコルなどに利用されます。

3.ユニークローカルアドレス  (fc00::/7)

サイトローカルアドレスでは、IPv4のプライベートアドレスで問題点を解決的ない為、廃止されました。その代わりに出来てたのが、ユニークローカルアドレスです。
ユニークローカルアドレスでは、グローバルIDと呼ばれる乱数を使用する事により、IPv4プライベートアドレスおよびリンクローカルアドレスの問題点だったアドレスの重複問題を解説している。(100%一意ではない。)




② エニーキャスト

エニーキャストアドレスは特にIPv6アドレス空間の中で決められた範囲ではなく,グローバルユニキャストアドレスと同じ空間を使用する事が可能。又、ひとつのアドレスを複数のインタフェースで共有する事が可能です。
エニーキャストアドレスを送信先アドレスとして指定すると、送信元から最も近いインタフェースにパケットが送信されることになります。

※「近い」という判断は、ネットワーク上で利用しているルーティングプロトコルのメトリックによって判断されます。

③マルチキャスト (FF00::/8)

マルチキャストはIPv6の機能のいくつかの中心的役割を担い,またブロードキャストの代替として使用される。又、マルチキャストアドレスはFF00::/8のプレフィックスを持ち,2オクテット目はフラグと範囲を決定します。残りの112ビットがグループのIDとなります。

FF02::1/128 … リンク上のすべてのノード
FF02::1:ff00:0/104 … リンク上の要請ノードマルチキャストアドレス
FF02::2/128 … リンク上のすべてのルータ
FF02::9/128 … リンク上のすべてのRIPルータ
FF05::101/128 … サイト上のすべてのNTPサーバ






2011年12月1日木曜日

OSPF マルチエリア 3.主要なOSPF設定一覧


主要なOSPF設定一覧



・OSPFの基本設定


1.OSPFのメトリックは「コスト」なので、帯域幅の設定は不可欠です。

Router(config)# interface serial 0
Router(config-if)# bandwidth { 帯域幅 }


2.各ネットワークをOSPFに参加される。

Router(config)# router ospf { プロセス番号 }
Router(config)# network { ネットワークアドレス } { ワイルドマスク } area { エリア番号 }




・スタブエリアの設定

スタブエリアとは、タイプ4,5を流さないエリア。

Router(config)# router ospf { プロセス番号 }
Router(config-router)# area { エリア番号  } stub 


・トータリースタブエリアの設定

トータリースタブエリアとは、タイプ3,4,5を流さないエリア。

Router(config)# router ospf { プロセス番号 }
Router(config-router)# area { エリア番号  } stub no-summary


・NSSAエリアの設定

NSSAエリアとは、スタブエリア内にASBRが存在する事が出来るエリア。

Router(config)# router ospf { プロセス番号 }
Router(config-router)# area { エリア番号 } nssa 


・トータリーNSSAエリアの設定

トータリーNSSAエリアとは、トータリースタブエリアにASBRが存在する事が出来るエリア。

Router(config)# router ospf { プロセス番号 }
Router(config-router)# area { エリア番号 } nssa no-summary


・集約ルートの設定


Router(config)# router ospf { プロセス番号 }
Router(config-router)# area { 集約ルート先のエリア番号 } range { IPアドレス} {サブネットマスク}


・外部ルートのルート集約


Router(config)# router ospf { プロセス番号 }
Router(config-router)# summary-address { IPアドレス} {サブネットマスク}



・バーチャルリンクの設定


1.ルータIDを設定する。

Router(config)# router ospf { プロセス番号 }
Router(config-router)# router-id { IPアドレス}

2.仮想リンクを確立する。

Router(config)# router ospf { プロセス番号 }
Router(config-router)# area { 透過するエリア番号 } virtual-link { ルータID }


・helloタイマーとdeadタイマーの変更



Router(config)# interface {インターフェース名}
Router (config-if )# ip ospf hello-interval {時間}

Router (config-if )# ip ospf dead-interval {時間}