//To enable OSPF routing, use the global configuration command syntax: Router(config)#router ospf (process-id )s Router(config-router)#network address wildcard-mask area area-id ----------------------------------------------------------------------- //To create and assign an IP address to a loopback interface use the following commands Router(config)#interface loopback (number) Router(config-if)#ip address ip-address subnet-mask //This loopback interface should be configured with an address using a 32-bit subnet mask of 255.255.255.255 ------------------------------------------------------------------------ //Modify the OSPF priority by entering global interface configuration ip ospf priority command on an interface that is participating in OSPF. The command show ip ospf interface will display the interface priority value as well as other key information. Router(config-if)#ip ospf (prioritynumber ) Router#show ip ospf interfacetype (number ) ------------------------------------------------------------------------ // sætte båndbrede på et interface ¨ Router(config)#interface serial 0/0 Router(config-if)#bandwidth 56 ------------------------------------------------------------------------- //Use the following interface configuration command to set the link cost: can be between 1 and 65,535. Router(config-if)#ip ospf cost (number ) ------------------------------------------------------------------------- // syntax der aktivere log adjacency router(config-router)log-adjacency-changes ------------------------------------------------------------------------- // sætte password på ospf The password can be up to eight characters. Use the following command syntax to configure OSPF authentication Router(config-if)#ip ospf authentication-keypassword //After the password is configured, authentication must be enabled: Router(config-router)#areaarea-number authentication -------------------------------------------------------------------------- //To configure the hello and dead intervals on an interface, use the following commands: router (config)interface serial (nummer) Router(config-if)#ip ospf hello-interval (seconds) Router(config-if)#ip ospf dead-interval (seconds) ------------------------------------------------------------------------- //A configured default route is used by a router to generate a gateway of last resort. The static default route configuration syntax uses the network 0.0.0.0 address and a subnet mask 0.0.0.0: Router(config)#ip route 0.0.0.0 0.0.0.0 [interface | next-hop address ] //The following configuration statement will propagate this route to all the routers in a normal OSPF area: Router(config-router)#default-information originate _----------------------------------------------------------------------------- // Fejlfindning !!! -Hellos are not sent from both neighbors. -Hello and dead interval timers are not the same. -Interfaces are on different network types. -Authentication passwords or keys are different. -In OSPF routing it is also important to ensure the following: -All interfaces have the correct addresses and subnet mask. -network area statements have the correct wildcard masks. -network area statements put interfaces into the correct area. show ip protocol show ip route show ip ospf interface show ip ospf show ip ospf neighbor detail show ip ospf database debug ip route debug ip ospf events debug ip ospf adj ----------------------------------------------------------------------------- //configurer vlan i router #interface fastethernet 0/0.1 #description Management VLAN1 #encapsulation dot1q 1 #ip address 192.168.1.1 255.255.255.0 #interface fastethernet 0/0.2 #description Accounting VLAN20 #encapsulation dot1q 1 #ip address 192.168.2.1 255.255.255.0 #interface fastethernet 0/0.1 #description Sales VLAN30 #encapsulation dot1q 1 #ip address 192.168.3.1 255.255.255.0