2015年6月17日水曜日

GNS3+Cisco+Vyatta でOSPF

GNS3にQEMU VMでvyatta を乗せて、CiscoルータとVyattaでOSPFを試す。


GNS3接続構成
設定内容
Cisco R1(Cisco1700)
Ciscoはループバックで2つほど配信するInterfaceを作成してみる。
配信するInterfaceは"redistribute connected subnets"で配信する。

R1(config)#int e0
R1(config-if)#ip address 192.168.1.1 255.255.255.0
R1(config-if)#int e1
R1(config-if)#ip address 192.168.2.1 255.255.255.0
R1(config-if)#ip address 1.1.1.1 255.255.255.0
R1(config-if)#ip address 2.2.2.2 255.255.255.0
R1(config)#router ospf 1
R1(config-router)#router-id 10.0.0.3
R1(config-router)#network 192.168.1.0 255.255.255.0 area 0.0.0.0
R1(config-router)#network 192.168.2.0 255.255.255.0 area 0.0.0.0
R1(config-router)#redistribute connected subnets
R1(config-router)#end
R1#wr

Vyattaは"configure"で設定モードに移行する。。
設定を反映させるために、”commit”して"save"する。
Vyatta1
vyatta@vyatta# set interfaces ethernet eth0 address 192.168.1.2/24
vyatta@vyatta# set interfaces ethernet eth2 address 192.168.3.1/24
vyatta@vyatta# set protocols ospf parameters router-id 10.0.0.1
vyatta@vyatta# set protocols ospf area 0.0.0.0 network 192.168.1.0/24
vyatta@vyatta# set protocols ospf area 0.0.0.0 network 192.168.3.0/24
vyatta@vyatta# set protocols ospf redistribute connected
vyatta@vyatta# commit
vyatta@vyatta# save

Vyatta2
vyatta@vyatta# set interfaces ethernet eth2 address 192.168.3.2/24
vyatta@vyatta# set interfaces ethernet eth1 address 192.168.2.2/24
vyatta@vyatta# set protocols ospf parameters router-id 10.0.0.2
vyatta@vyatta# set protocols ospf area 0.0.0.0 network 192.168.3.0/24
vyatta@vyatta# set protocols ospf area 0.0.0.0 network 192.168.2.0/24
vyatta@vyatta# set protocols ospf redistribute connected
vyatta@vyatta# commit
vyatta@vyatta# save


OSPF動作確認

R1#show ip route
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

     1.0.0.0/24 is subnetted, 1 subnets
C       1.1.1.0 is directly connected, Loopback0
     2.0.0.0/24 is subnetted, 1 subnets
C       2.2.2.0 is directly connected, Loopback1
C    192.168.1.0/24 is directly connected, Ethernet0
C    192.168.2.0/24 is directly connected, Ethernet1
O    192.168.3.0/24 [110/20] via 192.168.2.2, 00:13:46, Ethernet1
                    [110/20] via 192.168.1.2, 00:13:46, Ethernet0

Vyattaは運用モード($)で動作確認する。

Vyatta1
vyatta@vyatta:~$ show ip route
Codes: K - kernel route, C - connected, S - static, R - RIP, O - OSPF,
       I - ISIS, B - BGP, > - selected route, * - FIB route

O>* 1.1.1.0/24 [110/20] via 192.168.1.1, eth0, 00:13:08
O>* 2.2.2.0/24 [110/20] via 192.168.1.1, eth0, 00:12:58
C>* 127.0.0.0/8 is directly connected, lo
O   192.168.1.0/24 [110/10] is directly connected, eth0, 00:18:23
C>* 192.168.1.0/24 is directly connected, eth0
O>* 192.168.2.0/24 [110/20] via 192.168.1.1, eth0, 00:15:12
  *                         via 192.168.3.2, eth2, 00:15:12
O   192.168.3.0/24 [110/10] is directly connected, eth2, 00:18:22
C>* 192.168.3.0/24 is directly connected, eth2

Vyatta2
vyatta@vyatta:~$ show ip route
Codes: K - kernel route, C - connected, S - static, R - RIP, O - OSPF,
       I - ISIS, B - BGP, > - selected route, * - FIB route

O>* 1.1.1.0/24 [110/20] via 192.168.2.1, eth1, 00:12:42
O>* 2.2.2.0/24 [110/20] via 192.168.2.1, eth1, 00:12:32
C>* 127.0.0.0/8 is directly connected, lo
O>* 192.168.1.0/24 [110/20] via 192.168.3.1, eth2, 00:14:45
  *                         via 192.168.2.1, eth1, 00:14:45
O   192.168.2.0/24 [110/10] is directly connected, eth1, 00:14:45
C>* 192.168.2.0/24 is directly connected, eth1
O   192.168.3.0/24 [110/10] is directly connected, eth2, 00:14:51
C>* 192.168.3.0/24 is directly connected, eth2
vyatta@vyatta:~$


0 件のコメント:

GoogleAD