- [Instructor] While the network command
has been the standard for years,
there's an additional way to activate OSPF on an interface
and it's actually simpler.
In lieu of network commands,
the IP OSPF command
can be used directly on interfaces that should run OSPF.
Refer to this diagram.
I pre-configured all routers, say for Router 1.
I'll enable OSPF on interface Gi0/1,
using the interface commands.
I'll start by creating the OSPF process
and giving it a router ID.
Config t.
Router OSPF 10.
Router-id 100.64.0.1.
Now, I'll enter the interface.
Interface gi0/1.
Time for the command.
IP OSPF 10 area 0.
That's it.
That's much simpler than managing network statements
and their masks.
There are some verification differences.
Like, show ip protocols,
will list the interface running
in an area with the addition of
routing on interfaces configured explicitly.
This configured explicitly line
indicates it was configured
via OSPF interface configuration commands.
A show IP OSPF show interface command
will also show some variation of
an attached via interface enabled
or enabled by interface config.
OSPF also has the concept of passive interfaces.
When an interface is set as passive,
OSPF will advertise any subnet assigned to it
but it won't receive or send
hello messages on that interface.
That means no neighbor relationships
can be formed over this link.
Its a good way to insure
that no misconfiguration
will allow an interface to accidentally form neighborships.
It's done in one of two ways.
Either individually specified
which interface should be passive
or the more preferred method
of making passive the default state
and expressly telling the router
which interfaces are not passive.
On router one,
I can enable this behavior
with config t, router OSPF 10, passive interface, default.
Now I'll specify which interfaces to create neighborships.
No passive interface gi0/1.
The only show command, other than show run,
that displays the passive status is via show OSPF interface.
The command will display a single line
saying no hellos passive interface.
It's very popular in most networks
to utilize a default route.
It's a simple way to carry traffic towards the internet
without having to hold the full internet routing table.
The default route
has to be injected into OSPF,
so that it can be advertised to other OSPF speaking routers.
The default route has to be in the RIP,
either via static route, DHCP,
or even another dynamic routing protocol.
Examine this diagram.
I'll configure router one
to advertise the default route
to router two and router three.
First, I'll put a static default route to the internet.
Config t, IP route 0.0.0.0, 0.0.0.0.
The next hop to 192.168.1.2.
Now that there's a default route in the RIP,
I'll advertise it to OSPF.
First, router OSPF 10.
And now the default information originate command.
I'll pop over to router two
and double-check its routing table.
Show IP route.
The route table has now learned the default route via OSPF.
There's another method
that doesn't require a default route in the RIP
on the originating router.
By simply changing the default information command
to default information originate always.
As discussed previously,
PAS selection in OSPF
is dependent on interface cost added up to a destination.
The cost can be manipulated by the administrator
in a few different ways.
This allows some control over the PAS selection process.
One direct method is to configure costs
directly on an interface on a interface sub command.
On router one,
I would do it with config t, interface gi0/2,
IP OSPF cost 300.
By default,
OSPF uses the interface's bandwidth to determine cost.
This can be adjusted manually as well.
Interface gi0/3, bandwidth 10.
A third, and best practice,
is to adjust the auto reference bandwidth command.
Take a look at this chart.
As is easily seen,
fast ethernet and above all end up having a cost of one.
On networks with 10 gig interfaces,
the following OSPF sub command
will adjust the reference bandwidth on all interfaces.
Router OSPF 10 to enter the process.
And now auto cost reference bandwidth 10000.
This would make 10 gig interfaces have a cost of one.
One gig would have a cost of 10.
100 mg interfaces would have a cost of 100 and so on.
It's highly recommended, as per the message on the screen,
that the same auto cost command is added to all routers
in the autonomous system.
The reference bandwidth is a default command
I add to all OSPF networks I configure on Cisco Kit,
and I'd recommend you add it to yours too.