Difference between revisions of "OSPF Cisco IOS"

From Teknologisk videncenter
Jump to: navigation, search
(Example 1)
(Example 1)
Line 6: Line 6:
 
[[image:OPSF network 1.png|thumb|500px|none|Example network 1]]
 
[[image:OPSF network 1.png|thumb|500px|none|Example network 1]]
 
<br/>
 
<br/>
{|class="wikitable"
+
<div style="float: left; margin:0.5ex 0ex 0.5ex 0.5ex; padding: 0.2ex 0.3ex; border:1px solid #888888; background-color:{{{color|#EEEEEE}}}">
|==== R1 config ====
+
==== R1 config ====
|<source lang="text">
+
<source lang="text">
|hostname R1
+
hostname R1
|!
+
!
|interface fastethernet 0/0
+
interface fastethernet 0/0
ip address 192.168.0.1 255.255.255.0
+
  ip address 192.168.0.1 255.255.255.0
|!
+
!
|interface fastethernet 0/1
+
interface fastethernet 0/1
ip address 10.0.1.1 255.255.255.0
+
  ip address 10.0.1.1 255.255.255.0
|!
+
!
|router ospf 88
+
router ospf 88
network 192.168.0.0 0.0.0.255
+
  network 192.168.0.0 0.0.0.255
network 10.0.1.0 0.0.0.255
+
  network 10.0.1.0 0.0.0.255
|</source>
+
</source>
|-
+
</div>
|==== R2 config ====
+
<div style="float: left; margin:0.5ex 0ex 0.5ex 0.5ex; padding: 0.2ex 0.3ex; border:1px solid #888888; background-color:{{{color|#EEEEEE}}}">
|<source lang="text">
+
==== R2 config ====
|hostname R2
+
<source lang="text">
|!
+
hostname R2
|interface fastethernet 0/0
+
!
ip address 192.168.0.2 255.255.255.0
+
interface fastethernet 0/0
|!
+
  ip address 192.168.0.2 255.255.255.0
|interface fastethernet 0/1
+
!
ip address 10.0.2.1 255.255.255.0
+
interface fastethernet 0/1
|!
+
  ip address 10.0.2.1 255.255.255.0
|router ospf 77
+
!
network 192.168.0.0 0.0.0.255
+
router ospf 77
network 10.0.2.0 0.0.0.255
+
  network 192.168.0.0 0.0.0.255
|</source>
+
  network 10.0.2.0 0.0.0.255
|}==== R3 config ====
+
</source>
 +
</div>
 +
<div style="float: left; margin:0.5ex 0ex 0.5ex 0.5ex; padding: 0.2ex 0.3ex; border:1px solid #888888; background-color:{{{color|#EEEEEE}}}">
 +
==== R3 config ====
 +
<source lang="text">
 +
hostname R3
 +
!
 +
interface fastethernet 0/0
 +
  ip address 192.168.0.3 255.255.255.0
 +
!
 +
interface fastethernet 0/1
 +
  ip address 10.0.3.1 255.255.255.0
 +
!
 +
interface serial 0/0
 +
  ip address 172.16.0.1 255.255.255.252
 +
!
 +
router ospf 66
 +
  network 192.168.0.0 0.0.0.255
 +
  network 10.0.3.0 0.0.0.255
 +
  network 172.16.0.0 0.0.0.3
 +
</source>
 +
</div>
 +
<div style="float: left; margin:0.5ex 0ex 0.5ex 0.5ex; padding: 0.2ex 0.3ex; border:1px solid #888888; background-color:{{{color|#EEEEEE}}}">
 +
==== R4 config ====
 +
<source lang="text">
 +
hostname R4
 +
!
 +
interface fastethernet 0/1
 +
  ip address 10.0.4.1 255.255.255.0
 +
!
 +
interface serial 0/0
 +
  ip address 172.16.0.2 255.255.255.252
 +
router ospf 66
 +
  network 172.16.0.0 0.0.0.3
 +
  network 10.0.4.0 0.0.0.255
 +
</source>
 +
</div>

Revision as of 07:27, 10 February 2009

Single Area configuration

Example 1

Example network 1


R1 config

hostname R1
!
interface fastethernet 0/0
  ip address 192.168.0.1 255.255.255.0
!
interface fastethernet 0/1
  ip address 10.0.1.1 255.255.255.0
!
router ospf 88
  network 192.168.0.0 0.0.0.255
  network 10.0.1.0 0.0.0.255

R2 config

hostname R2
!
interface fastethernet 0/0
  ip address 192.168.0.2 255.255.255.0
!
interface fastethernet 0/1
  ip address 10.0.2.1 255.255.255.0
!
router ospf 77
  network 192.168.0.0 0.0.0.255
  network 10.0.2.0 0.0.0.255

R3 config

hostname R3
!
interface fastethernet 0/0
  ip address 192.168.0.3 255.255.255.0
!
interface fastethernet 0/1
  ip address 10.0.3.1 255.255.255.0
!
interface serial 0/0
  ip address 172.16.0.1 255.255.255.252
!
router ospf 66
  network 192.168.0.0 0.0.0.255
  network 10.0.3.0 0.0.0.255
  network 172.16.0.0 0.0.0.3

R4 config

hostname R4
!
interface fastethernet 0/1
  ip address 10.0.4.1 255.255.255.0
!
interface serial 0/0
  ip address 172.16.0.2 255.255.255.252
router ospf 66
  network 172.16.0.0 0.0.0.3
  network 10.0.4.0 0.0.0.255