OSPFの設定(2)
前回はベーシックなOSPFの設定を実施しました
では今回は、redistribute-staticを実践してみたいと思います
| Building configuration…
Current configuration : 671 bytes |
JUNOSの設定をしてみましょう、前回までの設定でconfigは下のようになっています
| root# show | no-more ## Last changed: 2009-10-11 20:45:39 UTC version 8.3R2.8; system { root-authentication { encrypted-password “$1$nIAA3PPr$ZKvo645RSZFDGCmfweQRb1″; ## SECRET-DATA } syslog { user * { any emergency; } file messages { any notice; authorization info; } file interactive-commands { interactive-commands any; } } } interfaces { fxp0 { unit 0 { family inet { address 192.168.0.1/24; } } } lo0 { unit 0 { family inet { address 10.0.1.1/32; } } } } protocols { ospf { area 0.0.0.0 { interface fxp0.0; interface lo0.0; } } } |
|
[edit] root# set routing-options static route 172.30.0.0/24 next-hop 192.168.0.250 |
| [edit] root# set policy-options policy-statement REDIST_STATIC term 10 from protocol static [edit] [edit] [edit] |
|
[edit] root# set protocols ospf export REDIST_STATIC |
|
Router#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
172.30.0.0/24 is subnetted, 1 subnets
O E2 172.30.0.0 [110/0] via 192.168.0.1, 00:00:11, Ethernet0
10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
O 10.0.1.1/32 [110/10] via 192.168.0.1, 00:00:11, Ethernet0
C 10.0.0.0/24 is directly connected, Loopback0
C 192.168.0.0/24 is directly connected, Ethernet0
Router#
|
タグ
2009年10月11日 | コメント/トラックバック(0) |
カテゴリー:JUNOS
OSPFの設定(1)
今回はOSPFの基本設定について解説していきたいと思います
ますは前提となるセグメント情報ですが、次のようになっています
使用ルータ JUNOS-BOX x1、2501 x1
Cisco⇔Juniper間のセグメント・・192.168.0.0/24
Juniper側 fxp0・・・・・・192.168.0.1
Cisco側 Ethernet0・・192.168.0.2
Ciscoのloopbackアドレス・・・・・・10.0.0.1/24
Juniperのループバックアドレス・・10.0.1.1/32
全て、OSPF エリア0で設定します
今回の2501ルータの設定は次のようにしました
|
Building configuration…
Current configuration : 654 bytes |
では、JUNOS-BOXの設定を実施してみましょう
なお、各インターフェースへIP設定は終了しているものとします
JUNOSでOSPFの設定を行う場合は次のコマンドで実施します
set protocols ospf area エリア番号 interface インターフェース名
少し、ややこしいかもしれませんが、OSPFはprotocols階層にあり、
OSPFエリアごとにどのinterfaeceで使用するかを割り当てていきます
では、ospf area 0へfxp0とlo0の設定をしてみましょう
|
[edit] root# set protocols ospf area 0 interface fxp0 [edit] |
できあがった コンフィグを確認してcommitしましょう
|
[edit] root# show | no-more ## Last changed: 2009-10-11 08:10:58 UTC version 8.3R2.8; system { root-authentication { encrypted-password “$1$nIAA3PPr$ZKvo645RSZFDGCmfweQRb1″; ## SECRET-DATA } syslog { user * { any emergency; } file messages { any notice; authorization info; } file interactive-commands { interactive-commands any; } } } interfaces { fxp0 { unit 0 { family inet { address 192.168.0.1/24; } } } lo0 { unit 0 { family inet { address 10.0.1.1/32; } } } } protocols { ospf { area 0.0.0.0 { interface fxp0.0; interface lo0.0; } } } [edit] [edit] |
ではOSPFが想定どおりに動作しているか確認します
次のコマンドを使って確認してみましょう
show ospf database
show route
コンフィギュレーションモードから実施するために各コマンドの前に run を入れてから実施します
|
root# run show ospf database
OSPF link state database, Area 0.0.0.0 root# run show route inet.0: 5 destinations, 5 routes (5 active, 0 holddown, 0 hidden) 10.0.0.1/32 *[OSPF/10] 00:15:35, metric 2 __juniper_private1__.inet6.0: 1 destinations, 1 routes (1 active, 0 holddown, 0 hidden) fe80::2e0:b6ff:fe06:286b/128 [edit] |
正常にOSPFが動作していそうです、では各インターフェースへping疎通確認を行ってみましょう
|
[edit] root# run ping 192.168.0.1 count 5 rapid PING 192.168.0.1 (192.168.0.1): 56 data bytes !!!!! — 192.168.0.1 ping statistics — 5 packets transmitted, 5 packets received, 0% packet loss round-trip min/avg/max/stddev = 0.025/0.034/0.065/0.016 ms [edit] [edit] [edit] [edit] |
OSPFの基本設定はこれで終わりです
タグ
2009年10月10日 | コメント/トラックバック(0) |
カテゴリー:JUNOS



