lost and found ( for me ? )

quagga on CentOS6 part2 : OSPF


[ network topology ]





[ quagga1 ]

quagga1# show  version
Quagga 0.99.15 (quagga1).
Copyright 1996-2005 Kunihiro Ishiguro, et al.

# egrep -v ^# /etc/sysconfig/quagga
QCONFDIR="/etc/quagga"
BGPD_OPTS="-A 127.0.0.1 -f ${QCONFDIR}/bgpd.conf"
OSPF6D_OPTS="-A ::1 -f ${QCONFDIR}/ospf6d.conf"
OSPFD_OPTS="-A 127.0.0.1 -f ${QCONFDIR}/ospfd.conf"
RIPD_OPTS="-A 127.0.0.1 -f ${QCONFDIR}/ripd.conf"
RIPNGD_OPTS="-A ::1 -f ${QCONFDIR}/ripngd.conf"
ZEBRA_OPTS="-A 127.0.0.1 -f ${QCONFDIR}/zebra.conf"
ISISD_OPTS="-A ::1 -f ${QCONFDIR}/isisd.conf"

WATCH_OPTS=""
WATCH_DAEMONS="zebra bgpd ospfd ospf6d ripd ripngd"


vtysh.conf
# cat /etc/quagga/vtysh.conf
hostname quagga1
password zebra
enable password zebra


zebra.conf
# cat /etc/quagga/zebra.conf!
hostname quagga1
password zebra
enable password zebra
!
interface eth0
ip address 192.168.0.254/24
ipv6 nd suppress-ra
!
interface eth1
ip address 192.168.1.254/24
ipv6 nd suppress-ra
!
interface lo
ip address 127.0.0.1/8
!!
ip forwarding
!
!
line vty
!
log stdout
log file /var/log/quagga/zebra.log


ospfd.conf
# cat /etc/quagga/ospfd.conf
hostname quagga1
password zebra
enable password zebra

interface eth0
interface eth1

router ospf
network 192.168.0.0/24 area 0
network 192.168.1.0/24 area 0

log stdout
log file /var/log/quagga/ospfd.log


[ quagga2 ]
# egrep -v ^# /etc/sysconfig/quagga
QCONFDIR="/etc/quagga"
BGPD_OPTS="-A 127.0.0.1 -f ${QCONFDIR}/bgpd.conf"
OSPF6D_OPTS="-A ::1 -f ${QCONFDIR}/ospf6d.conf"
OSPFD_OPTS="-A 127.0.0.1 -f ${QCONFDIR}/ospfd.conf"
RIPD_OPTS="-A 127.0.0.1 -f ${QCONFDIR}/ripd.conf"
RIPNGD_OPTS="-A ::1 -f ${QCONFDIR}/ripngd.conf"
ZEBRA_OPTS="-A 127.0.0.1 -f ${QCONFDIR}/zebra.conf"
ISISD_OPTS="-A ::1 -f ${QCONFDIR}/isisd.conf"

WATCH_OPTS=""
WATCH_DAEMONS="zebra bgpd ospfd ospf6d ripd ripngd"


vtysh.conf
# cat /etc/quagga/vtysh.conf
hostname quagga2
password zebra
enable password zebra


cat /etc/quagga/zebra.conf
hostname quagga2
password zebra
enable password zebra
!
interface eth0
ip address 192.168.0.253/24
ipv6 nd suppress-ra
!
interface eth1
ip address 192.168.2.254/24
ipv6 nd suppress-ra
!
interface lo
ip address 127.0.0.1/8
!
ip forwarding
!
!
line vty
!
log stdout
log file /var/log/quagga/zebra.log


ospfd.conf
# cat ospfd.conf
hostname quagga1
password zebra
enable password zebra

interface eth0
interface eth1

router ospf
network 192.168.0.0/24 area 0
network 192.168.2.0/24 area 0

log stdout
log file /var/log/quagga/ospfd.log


change file owner
# chown quagga.quagga /etc/quagga/ospfd.conf


restart zebra , ospfd on both quagga boxes
# /etc/init.d/zebra restart
# /etc/init.d/ospfd restart


connect to quagga1
# vtysh

Hello, this is Quagga (version 0.99.15).
Copyright 1996-2005 Kunihiro Ishiguro, et al.

quagga1# show  ip route
Codes: K - kernel route, C - connected, S - static, R - RIP, O - OSPF,
      I - ISIS, B - BGP, > - selected route, * - FIB route

C>* 127.0.0.0/8 is directly connected, lo
K>* 169.254.0.0/16 is directly connected, eth1
O   192.168.0.0/24 [110/10] is directly connected, eth0, 00:00:25
C>* 192.168.0.0/24 is directly connected, eth0
O   192.168.1.0/24 [110/10] is directly connected, eth1, 00:00:25
C>* 192.168.1.0/24 is directly connected, eth1

quagga1# show  ip ospf
OSPF Routing Process, Router ID: 192.168.1.254
Supports only single TOS (TOS0) routes
This implementation conforms to RFC2328
RFC1583Compatibility flag is disabled
OpaqueCapability flag is disabled
Initial SPF scheduling delay 200 millisec(s)
Minimum hold time between consecutive SPFs 1000 millisec(s)
Maximum hold time between consecutive SPFs 10000 millisec(s)
Hold time multiplier is currently 4
SPF algorithm last executed 1m54s ago
SPF timer is inactive
Refresh timer 10 secs
Number of external LSA 0. Checksum Sum 0x00000000
Number of opaque AS LSA 0. Checksum Sum 0x00000000
Number of areas attached to this router: 1

Area ID: 0.0.0.0 (Backbone)
  Number of interfaces in this area: Total: 2, Active: 2
  Number of fully adjacent neighbors in this area: 1
  Area has no authentication
  SPF algorithm executed 3 times
  Number of LSA 3
  Number of router LSA 2. Checksum Sum 0x0000b876
  Number of network LSA 1. Checksum Sum 0x00009123
  Number of summary LSA 0. Checksum Sum 0x00000000
  Number of ASBR summary LSA 0. Checksum Sum 0x00000000
  Number of NSSA LSA 0. Checksum Sum 0x00000000
  Number of opaque link LSA 0. Checksum Sum 0x00000000
  Number of opaque area LSA 0. Checksum Sum 0x00000000


connect to quagga2
# vtysh

Hello, this is Quagga (version 0.99.15).
Copyright 1996-2005 Kunihiro Ishiguro, et al.

quagga2# show  ip route
Codes: K - kernel route, C - connected, S - static, R - RIP, O - OSPF,
      I - ISIS, B - BGP, > - selected route, * - FIB route

C>* 127.0.0.0/8 is directly connected, lo
K>* 169.254.0.0/16 is directly connected, eth1
O   192.168.0.0/24 [110/10] is directly connected, eth0, 00:00:06
C>* 192.168.0.0/24 is directly connected, eth0
O   192.168.2.0/24 [110/10] is directly connected, eth1, 00:00:06
C>* 192.168.2.0/24 is directly connected, eth1

quagga2# show  ip ospf
OSPF Routing Process, Router ID: 192.168.2.254
Supports only single TOS (TOS0) routes
This implementation conforms to RFC2328
RFC1583Compatibility flag is disabled
OpaqueCapability flag is disabled
Initial SPF scheduling delay 200 millisec(s)
Minimum hold time between consecutive SPFs 1000 millisec(s)
Maximum hold time between consecutive SPFs 10000 millisec(s)
Hold time multiplier is currently 1
SPF algorithm last executed 41m05s ago
SPF timer is inactive
Refresh timer 10 secs
Number of external LSA 0. Checksum Sum 0x00000000
Number of opaque AS LSA 0. Checksum Sum 0x00000000
Number of areas attached to this router: 1

Area ID: 0.0.0.0 (Backbone)
  Number of interfaces in this area: Total: 2, Active: 2
  Number of fully adjacent neighbors in this area: 1
  Area has no authentication
  SPF algorithm executed 4 times
  Number of LSA 3
  Number of router LSA 2. Checksum Sum 0x0000c066
  Number of network LSA 1. Checksum Sum 0x00008c27
  Number of summary LSA 0. Checksum Sum 0x00000000
  Number of ASBR summary LSA 0. Checksum Sum 0x00000000
  Number of NSSA LSA 0. Checksum Sum 0x00000000
  Number of opaque link LSA 0. Checksum Sum 0x00000000
  Number of opaque area LSA 0. Checksum Sum 0x00000000


ospfd.log ( quagga1 )
# cat /var/log/quagga/ospfd.log

2012/11/23 22:40:17 OSPF: OSPFd 0.99.15 starting: vty@2604
2012/11/23 22:40:17 OSPF: interface 192.168.0.254 [2] join AllSPFRouters Multicast group.
2012/11/23 22:40:17 OSPF: interface 192.168.1.254 [3] join AllSPFRouters Multicast group.
2012/11/23 22:40:23 OSPF: ospfTrapNbrStateChange trap sent: 192.168.0.253 now Init/DROther
2012/11/23 22:40:23 OSPF: DR-Election[1st]: Backup 192.168.0.254
2012/11/23 22:40:23 OSPF: DR-Election[1st]: DR     192.168.0.253
2012/11/23 22:40:23 OSPF: DR-Election[2nd]: Backup 192.168.0.254
2012/11/23 22:40:23 OSPF: DR-Election[2nd]: DR     192.168.0.253
2012/11/23 22:40:23 OSPF: ospfTrapIfStateChange trap sent: 192.168.0.254 now Backup
2012/11/23 22:40:23 OSPF: interface 192.168.0.254 [2] join AllDRouters Multicast group.
2012/11/23 22:40:23 OSPF: DR-Election[1st]: Backup 192.168.0.254
2012/11/23 22:40:23 OSPF: DR-Election[1st]: DR     192.168.0.253
2012/11/23 22:40:23 OSPF: Packet[DD]: Neighbor 192.168.2.254 Negotiation done (Slave).


ospfd.log ( quagga2 )
# cat /var/log/quagga/ospfd.log

2012/11/23 22:41:23 OSPF: OSPFd 0.99.15 starting: vty@2604
2012/11/23 22:41:23 OSPF: interface 192.168.0.253 [2] join AllSPFRouters Multicast group.
2012/11/23 22:41:23 OSPF: interface 192.168.2.254 [3] join AllSPFRouters Multicast group.
2012/11/23 22:41:27 OSPF: ospfTrapNbrStateChange trap sent: 192.168.0.254 now Init/DROther
2012/11/23 22:41:27 OSPF: DR-Election[1st]: Backup 192.168.0.253
2012/11/23 22:41:27 OSPF: DR-Election[1st]: DR     192.168.0.254
2012/11/23 22:41:27 OSPF: DR-Election[2nd]: Backup 192.168.0.253
2012/11/23 22:41:27 OSPF: DR-Election[2nd]: DR     192.168.0.254
2012/11/23 22:41:27 OSPF: ospfTrapIfStateChange trap sent: 192.168.0.253 now Backup
2012/11/23 22:41:27 OSPF: interface 192.168.0.253 [2] join AllDRouters Multicast group.
2012/11/23 22:41:27 OSPF: DR-Election[1st]: Backup 192.168.0.253
2012/11/23 22:41:27 OSPF: DR-Election[1st]: DR     192.168.0.254
2012/11/23 22:41:27 OSPF: Packet[DD]: Neighbor 192.168.1.254: Initial DBD from Slave, ignoring.
2012/11/23 22:41:27 OSPF: Packet[DD]: Neighbor 192.168.1.254 Negotiation done (Master).
2012/11/23 22:41:27 OSPF: nsm_change_state(192.168.1.254, Loading -> Full): scheduling new router-LSA origination


send icmp packets to client2(192.168.2.10) from client1(192.168.1.10) to confirm the routing tables on both quagga boxes work correctly.
# ping 192.168.2.10 -c 1
PING 192.168.2.10 (192.168.2.10) 56(84) bytes of data.
64 bytes from 192.168.2.10: icmp_seq=1 ttl=62 time=1.60 ms

--- 192.168.2.10 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 2ms
rtt min/avg/max/mdev = 1.605/1.605/1.605/0.000 ms


[ ospf packets captured on quagga1 eth0 device ]
# tshark -i eth0 -w ospfd.pcap ip proto ospf

# tshark -nr ospfd.pcap
Running as user "root" and group "root". This could be dangerous.
 1   0.000000 192.168.0.253 -> 224.0.0.5    OSPF Hello Packet
 2   0.147259 192.168.0.254 -> 224.0.0.5    OSPF Hello Packet
 3   8.046384 192.168.0.254 -> 224.0.0.5    OSPF Hello Packet
 4   9.999971 192.168.0.253 -> 224.0.0.5    OSPF Hello Packet
 5  10.002025 192.168.0.254 -> 192.168.0.253 OSPF DB Descr.
 6  10.002747 192.168.0.253 -> 192.168.0.254 OSPF DB Descr.
 7  10.002883 192.168.0.254 -> 192.168.0.253 OSPF DB Descr.
 8  10.003525 192.168.0.253 -> 192.168.0.254 OSPF DB Descr.
 9  10.003640 192.168.0.254 -> 192.168.0.253 OSPF DB Descr.
10  10.003743 192.168.0.254 -> 192.168.0.253 OSPF LS Request
11  10.004332 192.168.0.253 -> 224.0.0.5    OSPF LS Update
12  10.004370 192.168.0.253 -> 224.0.0.5    OSPF LS Update
13  11.001644 192.168.0.254 -> 224.0.0.5    OSPF LS Acknowledge
14  14.004801 192.168.0.253 -> 224.0.0.5    OSPF LS Update
15  14.004950 192.168.0.254 -> 224.0.0.5    OSPF LS Update
16  14.829137 192.168.0.253 -> 224.0.0.5    OSPF LS Acknowledge
17  15.005115 192.168.0.254 -> 224.0.0.5    OSPF LS Acknowledge
18  18.046560 192.168.0.254 -> 224.0.0.5    OSPF Hello Packet


[ how to connect to zebra over telnet ]

zebra is listening to TCP 2601.
# telnet 127.1 2601
Trying 127.0.0.1...
Connected to 127.1.
Escape character is '^]'.

Hello, this is Quagga (version 0.99.15).
Copyright 1996-2005 Kunihiro Ishiguro, et al.


[ how to connect to ospfd over telnet ]

ospfd is listening to TCP 2604.
# telnet 127.1 2604
Trying 127.0.0.1...
Connected to 127.1.
Escape character is '^]'.

Hello, this is Quagga (version 0.99.15).
Copyright 1996-2005 Kunihiro Ishiguro, et al.


User Access Verification

Password:
quagga1> enable
Password:
quagga1# conf t
quagga1(config)# show run

Current configuration:
!
hostname quagga1
password zebra
enable password zebra
log file /var/log/quagga/ospfd.log
log stdout
!
!
!
interface eth0
!
interface eth1
!
interface lo
!
router ospf
network 192.168.0.0/24 area 0.0.0.0
network 192.168.1.0/24 area 0.0.0.0
!
line vty
!
end
quagga1(config)#
quagga1# write me
quagga1# write memory
Configuration saved to /etc/quagga/ospfd.conf


No comments:

Post a Comment

Note: Only a member of this blog may post a comment.