Search Windows and Linux Networking

Showing posts with label Cisco. Show all posts
Showing posts with label Cisco. Show all posts

Thursday, November 3, 2011

Configure Network With OSPF Multiple Area in Cisco Routers

 Configure Network With OSPF Multiple Area in Cisco Router

Last time we was setup single Area network with OSPF today we will setup our network Multiple Area with OSPF. see the following diagram.







Firstly we configure host name and interfaces of all Router and then configure routing 

Core 1

Router>enable
Router#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#hostname Core1
Core1(config)#

Core1(config)#interface FastEthernet 0/0
Core1(config-if)#ip address 172.9.0.1 255.255.0.0
Core1(config-if)#no shutdown
Core1(config-if)#exit

Core1(config)#interface serial 0/0/0
Core1(config-if)#ip address 192.168.8.1 255.255.255.0
Core1(config-if)#no shutdown
Core1(config-if)#exit

Core1(config)#interface serial 0/0/1
Core1(config-if)#ip address 172.14.0.254 255.255.0.0
Core1(config-if)#clock rate 64000
Core1(config-if)#no shutdown
Core1(config-if)#exit

Core1(config)#interface serial 0/1/0
Core1(config-if)#ip address 192.168.7.1 255.255.255.0
Core1(config-if)#clock rate 64000
Core1(config-if)#no shutdown
Core1(config-if)#exit

Core 2

Router>enable
Router#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#hostname Core2
Core2(config)#interface Serial 0/0/0
Core2(config-if)#ip address 192.168.8.2 255.255.255.0
Core2(config-if)#clock rate 64000
Core2(config-if)#no shutdown
Core2(config-if)#exit

Core2(config)#interface serial 0/1/0
Core2(config-if)#ip address 192.3.3.1 255.255.255.0
Core2(config-if)#clock rate 64000
Core2(config-if)#no shutdown
Core2(config-if)#exit

Core2(config)#interface serial 0/1/1
Core2(config-if)#ip address 192.168.4.154 255.255.255.0
Core2(config-if)#clock rate 64000
Core2(config-if)#no shutdown
Core2(config-if)#exit

Core2(config)#interface serial 0/0/1
Core2(config-if)#ip address 192.168.10.1 255.255.255.0
Core2(config-if)#clock rate 64000
Core2(config-if)#no shutdown
Core2(config-if)#exit

Core 3

Router>enable
Router#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#hostname Core3

Core3(config)#interface serial 0/1/0
Core3(config-if)#ip address 172.14.0.1 255.255.0.0
Core3(config-if)#no shutdown
Core3(config-if)#exit

Core3(config)#interface serial 0/0/0
Core3(config-if)#ip address 192.168.10.2 255.255.255.0
Core3(config-if)#no shutdown
Core3(config-if)#exit

Core3(config)#interface serial 0/0/1
Core3(config-if)#ip address 192.168.9.1 255.255.255.0
Core3(config-if)#clock rate 64000
Core3(config-if)#no shutdown
Core3(config-if)#exit

Core3(config)#interface serial 0/1/1
Core3(config-if)#ip address 192.168.2.1 255.255.255.0
Core3(config-if)#clock rate 64000
Core3(config-if)#no shutdown
Core3(config-if)#exit

Core 4

Router>enable
Router#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#hostname Core4

Core4(config)#interface Serial 0/0/0
Core4(config-if)#ip address 192.168.7.254 255.255.255.0
Core4(config-if)#no shutdown
Core4(config-if)#exit
Core4(config)#interface serial 0/0/1
Core4(config-if)#ip address 192.168.9.254 255.255.255.0
Core4(config-if)#no shutdown
Core4(config-if)#exit
Core4(config)#

Core4(config)#interface serial 0/1/0
Core4(config-if)#ip address 192.168.11.1 255.255.255.0
Core4(config-if)#clock rate 64000
Core4(config-if)#no shutdown
Core4(config-if)#exit

Core4(config)#interface serial 0/1/1
Core4(config-if)#ip address 192.168.12.1 255.255.255.0
Core4(config-if)#clock rate 64000
Core4(config-if)#no shutdown
Core4(config-if)#exit

Chicago

Router>enable
Router#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#hostname Chicago
Chicago(config)#interface serial 0/0/0
Chicago(config-if)#ip address 192.3.3.2 255.255.255.0
Chicago(config-if)#no shutdown
Chicago(config-if)#exit

Chicago(config)#interface FastEthernet 0/0
Chicago(config-if)#ip address 192.1.1.1 255.255.255.0
Chicago(config-if)#no shutdown
Chicago(config-if)#exit

France

Router>enable
Router#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#hostname France
France(config)#interface Serial 0/0/0
France(config-if)#ip address 192.168.4.2 255.255.255.0
France(config-if)#no shutdown
France(config-if)#exit

France(config)#interface FastEthernet 0/0
France(config-if)#ip address 192.2.2.1 255.255.255.0
France(config-if)#no shutdown
France(config-if)#exit

Japan

Router>enable
Router#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#hostname Japan
Japan(config)#interface serial 0/0/0
Japan(config-if)#ip address 192.168.2.254 255.255.255.0
Japan(config-if)#no shutdown
Japan(config-if)#exit

Japan(config)#interface fastEthernet 0/0
Japan(config-if)#ip address 172.10.0.1 255.255.0.0
Japan(config-if)#no shutdown
Japan(config-if)#exit

Pune

Router>enable
Router#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#hostname Pune
Pune(config)#interface serial 0/0/0
Pune(config-if)#ip address 192.168.11.254 255.255.255.0
Pune(config-if)#no shutdown
Pune(config-if)#exit

Pune(config)#interface fastEthernet 0/0
Pune(config-if)#ip address 172.16.0.1 255.255.0.0
Pune(config-if)#no shutdown
Pune(config-if)#exit

Mumbai

Router>enable
Router#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#hostname Mumbai
Mumbai(config-if)#ip address 192.168.12.254 255.255.255.0
Mumbai(config-if)#no shutdown
Mumbai(config-if)#exit

Mumbai(config)#interface fastEthernet 0/0
Mumbai(config-if)#ip address 172.15.0.254 255.255.0.0
Mumbai(config-if)#no shutdown
Mumbai(config-if)#exit

Next Step is to configure network Route. :-
we will configure nework route with OSPF with different area and with default route the network that are not connected to area 0. and save the configuration.



Core1

Core1(config)#router ospf 1
Core1(config-router)#do show ip int br
Interface              IP-Address      OK? Method Status                Protocol

FastEthernet0/0        172.9.0.1       YES manual up                    up

FastEthernet0/1        unassigned      YES unset  administratively down down

Serial0/0/0            192.168.8.1     YES manual up                    up

Serial0/0/1            172.14.0.254    YES manual up                    up

Serial0/1/0            192.168.7.1     YES manual up                    up

Serial0/1/1            unassigned      YES unset  administratively down down

Vlan1                  unassigned      YES unset  administratively down down
Core1(config-router)#
Core1(config-router)#network 172.9.0.0 0.0.255.255 area 0
Core1(config-router)#network 192.168.8.0 0.0.0.255 area 0
Core1(config-router)#network 172.14.0.0 0.0.255.255 area 0
Core1(config-router)#network 192.168.7.0 0.0.0.255 area 0
Core1(config-router)#exit
Core1(config)#exit
Save configuration
Core1#copy running-config startup-config
Destination filename [startup-config]?
Building configuration...
[OK]
Core1#


Core2
Core2(config)#router ospf 1
Core2(config-router)#do show ip int br
Interface              IP-Address      OK? Method Status                Protocol

FastEthernet0/0        unassigned      YES unset  administratively down down

FastEthernet0/1        unassigned      YES unset  administratively down down

Serial0/0/0            192.168.8.2     YES manual up                    up

Serial0/0/1            192.168.10.1    YES manual up                    up

Serial0/1/0            192.3.3.1       YES manual up                    up

Serial0/1/1            192.168.4.154   YES manual up                    up

Vlan1                  unassigned      YES unset  administratively down down
Core2(config-router)#network 192.168.8.0 0.0.0.255 area 0
Core2(config-router)#network 192.168.10.0 0.0.0.255 area 0
Core2(config-router)#network 192.3.3.0 0.0.0.255 area 2
Core2(config-router)#network 192.168.4.0 0.0.0.255 area 2
Core2(config-router)#exit
Core2(config)#exit
Save Configuration 
Core2#copy running-config startup-config
Destination filename [startup-config]?
Building configuration...
[OK]
Core2#

Core3
Core3(config)#router ospf 1
Core3(config-router)#do show ip int br
Interface              IP-Address      OK? Method Status                Protocol

FastEthernet0/0        unassigned      YES unset  administratively down down

FastEthernet0/1        unassigned      YES unset  administratively down down

Serial0/0/0            192.168.10.2    YES manual up                    up

Serial0/0/1            192.168.9.1     YES manual up                    up

Serial0/1/0            172.14.0.1      YES manual up                    up

Serial0/1/1            192.168.2.1     YES manual up                    up

Vlan1                  unassigned      YES unset  administratively down down
Core3(config-router)#
Core3(config-router)#network 192.168.10.0 0.0.0.255 area 0
Core3(config-router)#network 192.168.9.0 0.0.0.255 area 0
Core3(config-router)#network 172.14.0.0 0.0.255.255 area 0
Core3(config-router)#network 192.168.2.0 0.0.0.255 area 3
Core3(config-router)#exit
Core3(config)#exit
Save Configuration
Core3#copy running-config startup-config
Destination filename [startup-config]?
Building configuration...
[OK]
Core3#


Core4
Core4(config)#router ospf 1
Core4(config-router)#do show ip int br
Interface              IP-Address      OK? Method Status                Protocol

FastEthernet0/0        unassigned      YES unset  administratively down down

FastEthernet0/1        unassigned      YES unset  administratively down down

Serial0/0/0            192.168.7.254   YES manual up                    up

Serial0/0/1            192.168.9.254   YES manual up                    up

Serial0/1/0            192.168.11.1    YES manual up                    up

Serial0/1/1            192.168.12.1    YES manual up                    up

Vlan1                  unassigned      YES unset  administratively down down
Core4(config-router)#
Core4(config-router)#network 192.168.7.0 0.0.0.255 area 0
Core4(config-router)#network 192.168.9.0 0.0.0.255 area 0
Core4(config-router)#network 192.168.11.0 0.0.0.255 area 1
Core4(config-router)#network 192.168.12.0 0.0.0.255 area 1
Core4(config-router)#exit
Core4(config)#exit
Save Configuration
Core4#copy running-config startup-config
Destination filename [startup-config]?
Building configuration...
[OK]
Core4#

Chicago
Note:- Chicago network interface is not directly connected to Area 0 so to all communicant we also configure default route along with OSPF

Chicago(config)#router ospf 1
Chicago(config-router)#do show ip int br
Interface              IP-Address      OK? Method Status                Protocol

FastEthernet0/0        192.1.1.1       YES manual up                    up

FastEthernet0/1        unassigned      YES unset  administratively down down

Serial0/0/0            192.3.3.2       YES manual up                    up

Serial0/0/1            unassigned      YES unset  administratively down down

Vlan1                  unassigned      YES unset  administratively down down
Chicago(config-router)#
Chicago(config-router)#network 192.1.1.0 0.0.0.255 area 2
Chicago(config-router)#network 192.3.3.0 0.0.0.255 area 2
Chicago(config-router)#exit
Chicago(config)#ip route 0.0.0.0 0.0.0.0 serial 0/0/0
Chicago(config)#exit
Save Configuration
Chicago#copy running-config startup-config
Destination filename [startup-config]?
Building configuration...
[OK]
Chicago#

France
Note:- This network interface are also not directly connected to Area 0 so to all communicant we also configure default route along with OSPF
France(config)#router ospf 1
France(config-router)#do show ip int br
Interface              IP-Address      OK? Method Status                Protocol

FastEthernet0/0        192.2.2.1       YES manual up                    up

FastEthernet0/1        unassigned      YES unset  administratively down down

Serial0/0/0            192.168.4.2     YES manual up                    up

Serial0/0/1            unassigned      YES unset  administratively down down

Vlan1                  unassigned      YES unset  administratively down down
France(config-router)#
France(config-router)#network 192.2.2.0 0.0.0.255 area 2
France(config-router)#network 192.168.4.0 0.0.0.255 area 2
France(config-router)#exit
France(config)#ip route 0.0.0.0 0.0.0.0 serial 0/0/0
France(config)#exit
Save Configuration 

France#copy running-config startup-config
Destination filename [startup-config]?
Building configuration...
[OK]
France#

Japan
Note:- This network is also not directly connected to Area 0 so to all communicant we also configure default route along with OSPF 
Japan(config)#route ospf 1
Japan(config-router)#do show ip int br
Interface              IP-Address      OK? Method Status                Protocol

FastEthernet0/0        172.10.0.1      YES manual up                    up

FastEthernet0/1        unassigned      YES unset  administratively down down

Serial0/0/0            192.168.2.254   YES manual up                    up

Serial0/0/1            unassigned      YES unset  administratively down down

Vlan1                  unassigned      YES unset  administratively down down
Japan(config-router)#
Japan(config-router)#network 172.10.0.0 0.0.255.255 area 3
Japan(config-router)#network 192.168.2.0 0.0.0.255 area 3
Japan(config-router)#exit
Japan(config)#ip route 0.0.0.0 0.0.0.0 serial 0/0/0
Japan(config)#
Japan(config)#exit
Save Configuration
Japan#copy running-config startup-config
Destination filename [startup-config]?
Building configuration...
[OK]
Japan#

Pune
Note:- This network is also not directly connected to Area 0 so to all communicant we also configure default route along with OSPF  
Pune(config)#router ospf 1
Pune(config-router)#do show ip int br
Interface              IP-Address      OK? Method Status                Protocol

FastEthernet0/0        172.16.0.1      YES manual up                    up

FastEthernet0/1        unassigned      YES unset  administratively down down

Serial0/0/0            192.168.11.254  YES manual up                    up

Serial0/0/1            unassigned      YES unset  administratively down down

Vlan1                  unassigned      YES unset  administratively down down
Pune(config-router)#
Pune(config-router)#network 172.16.0.0 0.0.255.255 area 1
Pune(config-router)#network 192.168.11.0 0.0.0.255 area 1
Pune(config-router)#exit
Pune(config)#ip route 0.0.0.0 0.0.0.0 serial 0/0/0
Pune(config)#exit
Save Configuration
Pune#copy running-config startup-config
Destination filename [startup-config]?
Building configuration...
[OK]
Pune#

Mumbai
Mumbai(config)#router ospf 1
Mumbai(config-router)#do show ip int br
Interface              IP-Address      OK? Method Status                Protocol

FastEthernet0/0        172.15.0.254    YES manual up                    up

FastEthernet0/1        unassigned      YES unset  administratively down down

Serial0/0/0            192.168.12.254  YES manual up                    up

Serial0/0/1            unassigned      YES unset  administratively down down

Vlan1                  unassigned      YES unset  administratively down down
Mumbai(config-router)#
Mumbai(config-router)#network 172.15.0.0 0.0.255.255 area 1
Mumbai(config-router)#network 192.168.12.0 0.0.0.255 area 1
Mumbai(config-router)#exit
Mumbai(config)#exit
Save Configuration
Mumbai#copy running-config startup-config
Destination filename [startup-config]?
Building configuration...
[OK]
Mumbai#

It Done on Router site now go to PC and set ip address in same network and set default gateway as ip address of Router.
Next time we will see how to create VLAN in Cisco Devices.


Tuesday, October 25, 2011

Configure Cisco Router with OSPF and DHCP Relay Agent

Configure Network with using  Cisco Router and DHCP server

Today we will see how to configure cisco router with ospf and act as relay agent.


For example we have a DHCP Server that is configure to provide IP address two different network  192.168.0.0/24 and 192.168.2.0/24.  DHCP is providing correct ip in same network(head office) but in other network client are not getting ip address from DHCP server.
Problem is occurring  because by default router break broadcast domain .to fix the problem we have told router to allow DHCP DORA process



Head office Router

Router>
Router>enable
Router#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
HeadOffice(config)#hostname HeadOffice
HeadOffice(config)#interface FastEthernet 0/0
HeadOffice(config-if)#ip address 192.168.0.1 255.255.255.0
HeadOffice(config-if)#no shutdown

%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up

HeadOffice(config-if)#exit
HeadOffice(config)#interface FastEthernet 1/0
HeadOffice(config-if)#ip address 192.168.1.1 255.255.255.0
HeadOffice(config-if)#no shutdown

%LINK-5-CHANGED: Interface FastEthernet1/0, changed state to up

HeadOffice(config-if)#exit
HeadOffice(config)#

Configure routing with ospf:-

HeadOffice(config)#router ospf 1
HeadOffice(config-router)#network 192.168.0.0 0.0.0.255 area 0
HeadOffice(config-router)#network 192.168.1.0 0.0.0.255 area 0
HeadOffice(config-router)#

00:53:17: %OSPF-5-ADJCHG: Process 1, Nbr 192.168.2.1 on FastEthernet1/0 from LOADING to FULL, Loading Done

HeadOffice(config-router)#exit
HeadOffice(config)#exit

%SYS-5-CONFIG_I: Configured from console by console
HeadOffice#show ip route
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
       i - IS-IS, 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

C    192.168.0.0/24 is directly connected, FastEthernet0/0
C    192.168.1.0/24 is directly connected, FastEthernet1/0
O    192.168.2.0/24 [110/2] via 192.168.1.2, 00:00:18, FastEthernet1/0

HeadOffice#

Saving Our Configuration 

HeadOffice#copy running-config startup-config
Destination filename [startup-config]? [Press Enter Key]
Building configuration...
[OK]
HeadOffice#

Branch Office Router
Router> [Press Enter key]
Router>enable
Router#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#hostname branchoffice
branchoffice(config)#interface fastEthernet 1/0
branchoffice(config-if)#ip address 192.168.1.2 255.255.255.0
branchoffice(config-if)#no shutdown

%LINK-5-CHANGED: Interface FastEthernet1/0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet1/0, changed state to up

branchoffice(config-if)#exit
branchoffice(config)#interface fastEthernet 0/0
branchoffice(config-if)#ip address 192.168.2.1 255.255.255.0
branchoffice(config-if)#no shutdown

%LINK-5-CHANGED: Interface FastEthernet1/0, changed state to up

Configure routing with ospf

branchoffice(config)#router ospf 1
branchoffice(config-router)#network 192.168.1.0 0.0.0.255 area 0
branchoffice(config-router)#network 192.168.2.0 0.0.0.255 area 0
branchoffice(config-router)#exit
branchoffice(config)#exit
Verity Route:-

Verify all network are now known to router by show ip route command

branchoffice#show ip route
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
       i - IS-IS, 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

O    192.168.0.0/24 [110/2] via 192.168.1.1, 00:00:33, FastEthernet1/0
C    192.168.1.0/24 is directly connected, FastEthernet1/0
C    192.168.2.0/24 is directly connected, FastEthernet0/0
Check our network are accessible or not by ping command :- 

branchoffice#ping 192.168.0.2

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.0.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 31/31/32 ms


Configure Router for DHCP Relay agent 
By default Router break brodcast domain and dhcp DORA process run by brodcasting for DHCP Server to get IP address information so we need to told router to send dhcp brodcast to DHCP Server.

branchoffice#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
branchoffice(config)#interface fastEthernet 0/0
branchoffice(config-if)#ip helper-address 192.168.0.2
branchoffice(config-if)#exit
branchoffice(config)#exit
branchoffice#

Saving Our Configuration 


branchoffice#copy running-config startup-config
Destination filename [startup-config]? [Press Enter Key]
Building configuration...
[OK]
branchoffice#

Now DHCP server will provide correct ip address by looking at network request coming from for example 192.168.2.0 /24 network. it simple