Pages

Sunday, December 14, 2014

What is difference between PATH and LD_LIBRARY_PATH ?

PATH is for specifying directories of executable programs. LD_LIBRARY_PATH is used to specify directories of libraries.

How to check Linux OS

[guest@gsindia-shell ~]$ cat /etc/redhat-release

CentOS release 5.2 (Final)

Monday, December 8, 2014

Conventions used to set env PATH for different shell.

Setting path at Unix/Linux:
To add the Python directory to the path for a particular session in Unix:

In the csh shell: type
setenv PATH "$PATH:/usr/local/bin/python" and press Enter.

In the bash shell (Linux): type
export PATH="$PATH:/usr/local/bin/python" and press Enter.

In the sh or ksh shell: type

PATH="$PATH:/usr/local/bin/python" and press Enter.

Thursday, November 20, 2014

How to comment multiple lines in TCL

1st method :

# sadhfkhfksd \
sdfjkljdsf \
afls;dfksd \
asfj;lkgfsd \

sdfsdkgj

2nd method:

if {0} {
----
---
---
}

In python

In Python, you can comment multiple lines using triple quotes (`'''` or `"""`). Here's how:

```python
'''
This is a multiline comment.
You can write multiple lines here.
'''
```

or

```python
"""
This is another multiline comment.
You can also write multiple lines here.
"""
```

Alternatively, you can comment each line separately using the `#` character:

```python
# This is line 1 of the comment
# This is line 2 of the comment
# And so on...
```

Both methods are commonly used in Python to provide comments that span multiple lines, and the choice between them depends on personal preference and the specific context of your code.

Tuesday, November 4, 2014

parser proc in tcl

proc args_parser {args} {
    set length [llength $args]
    puts "Length of the args is $length"
    for { set i 0 } { $i < $length } { incr i } {
        set arg_name [lindex $args $i]
        incr i
        set arguments($arg_name) [lindex $args $i]
    }
    return [array get arguments]
}

proc b {args} {
    array set ar [eval args_parser $args]
    set name $ar(-name)
    set age $ar(-age)
    set country $ar(-country)
    set location $ar(-location)
    puts "$name is aged $age\n";
    puts "$name is located at $location,$country\n";
}

b -name nawraj -age 30 -location bangalore -country India


Parser in Python:

In Python, a parser is a program or module that takes input data (usually in the form of a string or a file) and processes it according to a specified grammar or set of rules. The parser analyzes the input data and produces a structured representation of its components, which can then be further processed or manipulated by the program.

There are various types of parsers used for different purposes in Python:

1. **String Parsers**: These parsers operate on strings of characters and extract relevant information according to a specified pattern or format. Regular expressions (regex) are commonly used for string parsing tasks, allowing developers to define patterns that match specific text patterns within strings.

2. **File Parsers**: These parsers read data from files and extract structured information from the file contents. For example, parsers for file formats such as CSV (Comma-Separated Values), JSON (JavaScript Object Notation), XML (eXtensible Markup Language), and YAML (YAML Ain't Markup Language) are commonly used to parse data files in those formats.

3. **Syntax Parsers**: These parsers analyze the syntax of programming languages or data formats and produce a structured representation of the input data. For example, parsers for programming languages such as Python, JavaScript, and Java parse source code files and generate abstract syntax trees (ASTs) representing the structure and semantics of the code.

4. **Markup Parsers**: These parsers are specifically designed to parse markup languages such as HTML (Hypertext Markup Language) and XML. They analyze the hierarchical structure of markup documents and provide APIs for navigating and manipulating the document structure.

Python provides several libraries and modules for parsing different types of data:

- The `re` module for regular expressions.
- The `csv` module for parsing CSV files.
- The `json` module for parsing JSON data.
- The `xml.etree.ElementTree` module for parsing XML data.
- The `yaml` module for parsing YAML data.
- External libraries such as BeautifulSoup for HTML parsing and Ply for creating parsers for custom grammars.

Overall, parsers play a crucial role in extracting structured information from raw data, enabling developers to work with data in a meaningful way within their Python programs.



Wednesday, September 3, 2014

OSPF MCQ

Q1) Which table is NOT maintained by a link-state routing protocol?
A) routing
B) topology
C) update
D) neighbor

Q2) The memory needed to maintain tables is one disadvantage of link-state protocols.
A) true
B) false

Q3) Match each table to its function.
A) routing
B) topology
C) neighbor
topology_____ 1. stores LSAs
neighbor_____ 2. stores adjacencies
routing_____ 3. stores best paths

Q4) Which term refers to the router that connects area 0 to a non backbone area?
A) area boundary router
B) area border router
C) autonomous system boundary router
D) backbone router

Q5) What is the recommended guideline for the maximum number of routers per OSPF area?
A) 50
B) 10
C) 200
D) 500

Q6) Which OSPF packet helps form the neighbor adjacency?
A) exchange packet
B) hello packet
C) neighbor discovery packet
D) adjacency packet

Q7) Which criterion does SPF use to determine the best path?
A) lowest delay
B) highest bandwidth
C) lowest total cost of the route
D) total bandwidth of the route

Q8) Which table is populated as a result of the SPF calculations?
A) topology
B) routing
C) adjacency
D) neighbor

Q9) Cisco recommends no more than _____ area or areas per ABR in addition to area 0.
A) one
B) two
C) four
D) eight

Q10) An area border router maintains _____.
A) a separate database for each area with which it is connected
B) a single database for all areas
C) two databases: one for the backbone and one for all others
D) a separate routing table for each area

Q11) In a multiarea network, any area can be the backbone area, although this is most often area 0.
A) true
B) false

Q12) When an LSA is received by an OSPF router, it is installed in the _____.
A) neighbor table
B) topology table
C) routing table

Q13) An OSPF router receives an LSA, the router checks its sequence number, and this
number matches the sequence number of the LSA that the receiving router already has.
What does the receiving router do with the LSA?
A) ignores the LSA
B) adds it to the database
C) sends newer LSU update to source router
D) floods the LSA to the other routers

Q14) An OSPF router receives an LSA. The router checks its sequence number and finds that
this number is higher than the sequence number it already has. Which two tasks does
the router perform with the LSA?
A) ignores the LSA
B) adds it to the database
C) sends newer LSU update to source router
D) floods the LSA to the other routers

Q15) An OSPF router receives an LSA. The router checks its sequence number and finds that
this number is lower than the sequence number it already has. What does the router do
with the LSA?
A) ignores the LSA
B) adds it to the database
C) sends newer LSU update to source router
D) floods the LSA to the other routers

Q16) Each LSA has its own age timer. By default, how long does an LSA wait before requiring an update?
A) 30 seconds
B) 1 minute
C) 30 minutes
D) 1 hour

Q17) Distance vector protocols use the concept of split horizon, but link-state routing protocols, such as OSPF, do not.
A) true
B) false

Q18) The outcome of Dijkstra’s calculation is used to populate the _____.
A) topology table
B) routing table
C) neighbor table
D) adjacency table

Q19) What is the IP protocol number for OSPF packets?
A) 89
B) 86
C) 20
D) 76

Q20) Which packet is NOT an OSPF packet type?
A) LSU
B) LSR
C) DBD
D) LSAck
E) hello
F) query

Q21) Which multicast address does the OSPF Hello protocol use?
A) 224.0.0.5
B) 224.0.0.6
C) 224.0.0.7
D) 224.0.0.8

Q22) The Hello protocol sends periodic updates to ensure that a neighbor relationship is maintained between adjacent routers.
A) true
B) false

Q23) Place the exchange protocol states in the correct order.
A) _____ two-way 3
B) _____ loading 6
C) _____ down 1
D) _____ full 7
E) _____ exchange 5
F) _____ init 2
G) _____ exstart 4

Q24) DBD packets are involved during which two states? (Choose two.)
A) exstart
B) loading
C) exchange
D) two-way

Q25) At which interval does OSPF refresh LSAs?
A) 10 seconds
B) 30 seconds
C) 30 minutes
D) 1 hour

Q26) Which field is NOT a field within an OSPF packet header?
A) packet length
B) router ID
C) authentication type
D) maxage time

Q27) Which two commands are required for basic OSPF configuration? (Choose two.)
A) network ip-address mask area area-id
B) network ip-address wildcard-mask area area-id
C) router ospf process-id
D) ip router ospf

Q28) Which OSPF show command describes a list of OSPF adjacencies?
A) show ip ospf interface
B) show ip ospf
C) show ip route
D) show ip ospf neighbor

Q29) Which technique is NOT used for router ID selection?
A) highest IP address on an interface
B) IP address on a loopback interface
C) lowest IP address when multiple loopback interfaces are used
D) the router-id command

Q30) When you are using the router-id command, the router ID immediately changes to the IP address that has been entered.
A) true
B) false

Q31) Which network statement is used to configure OSPF on an interface with IP address 172.16.1.1 in area 0?
A) network 172.16.0.0 0.0.0.255 area 0
B) network 172.16.1.1 0.0.0.0 area 0
C) network 172.16.1.1 255.255.255.255 area 0
D) network 172.16.0.0 0.0.255.255 area 0

Q32) Only one OSPF process can run on a Cisco router at one time.
A) true
B) false

Q33) Which mode is the ip ospf process-id area area-id command entered in?
A) (config)#
B) (config-if)#
C) (config-router)#
D) (config-if)# or (config-router)#

Q34) The OSPF router-id command should be used in global configuration mode.
A) true
B) false

Q35) A router has a FastEthernet interface with IP address 172.16.45.1, a loopback 0
interface with IP address 10.3.3.3, a loopback 1 interface with 10.2.2.2, and a router-id
command with IP address 10.1.1.1. Which router ID will be selected?
A) 172.16.45.1
B) 10.3.3.3
C) 10.2.2.2
D) 10.1.1.1

Q36) The show ip ospf neighbor command shows a FULL state on one of the two neighbors
in its table. Which neighbor or neighbors successfully exchange LSDB information?
A) neighbor in FULL state
B) neighbor not in FULL state
C) both have exchanged databases
D) neither has exchanged databases

Q37) Which two show commands can be used to verify the OSPF router ID of a router?
(Choose two.)
A) show ip ospf interface
B) show ip ospf neighbor
C) show ip ospf
D) show ip route

Q38) When you configure a loopback interface, you choose an IP address that is not going to
be advertised by OSPF. This loopback address _____.
A) cannot be a router ID because it cannot be pinged
B) can be the router ID, even though it cannot be pinged
C) can be the router ID and can be pinged if a private address is selected
D) cannot be the router ID; you should always advertise loopback addresses

Q39) Which statement describes the process ID on the router ospf command?
A) All OSPF routers in a network must have the same OSPF process ID.
B) The OSPF process ID is an internal number and does not need to match that on other routers.
C) The OSPF process ID is similar to an AS number.
D) There can be only one OSPF process ID in a router configuration.

Q40) OSPF does not require a Hello protocol on point-to-point links because the adjacent router is directly connected.
A) true
B) false

Q41) Three routers are connected to an Ethernet LAN. One is a small router that should not
take on the role of DR or BDR. How do you ensure that it never will?
A) Set the interface priority to 100.
B) Set the interface priority to 0.
C) Leave the interface priority set to 1 and set the priority of the other two routers to 10.
D) Use the no designated-router command on the Ethernet interface.

Q42) When the DR fails, the BDR builds new adjacencies, exchanges databases, and takes
over as DR automatically.
A) true
B) false

Q43) What is the default hello interval for NBMA interfaces?
A) 10 seconds
B) 30 seconds
C) 120 seconds
D) 60 seconds

Q44) An OSPF router automatically builds adjacencies with neighboring routers on an NBMA link.
A) true
B) false

Q45) Which mode of OSPF operation is RFC-compliant?
A) point-to-multipoint nonbroadcast
B) point-to-multipoint
C) broadcast
D) point-to-point

Q46) Match the OSPF over Frame Relay mode of operation with its description.
A) broadcast
B) point-to-multipoint
C) nonbroadcast
_____ 1. does not discover neighbors automatically c
_____ 2. discovers neighbors automatically and requires DR and BDR election a
_____ 3. used in partial-mesh topologies, does not require DR and BDR election, automatically discovers neighbors b

Q47) Which two OSPF over Frame Relay modes elect a DR? (Choose two.)
A) broadcast
B) nonbroadcast
C) point-to-multipoint
D) point-to-point

Q48) A point-to-point subinterface solves which two problems with OSPF over Frame Relay? (Choose two.)
A) works with multiple vendors
B) manual configuration of neighbors not required
C) DR and BDR not required
D) saves on subnets

Q49) When troubleshooting a DR election problem, which is an excellent command to use?
A) show ip ospf
B) show ip route
C) debug ip ospf neighbor
D) debug ip ospf adj

Q50) Which destination IP address does OSPF use when advertising to all SPF routers?
A) 224.0.0.6
B) 224.0.0.5
C) 255.255.255.255
D) IP address of output interface

Q51) What are the three types of networks defined by OSPF? (Choose three.)
A) point-to-point
B) broadcast
C) point-to-multipoint
D) point-to-multipoint nonbroadcast
E) nonbroadcast multiaccess

Q52) With a hello interval of 10 seconds, what does the dead interval default to?
A) 10 seconds
B) 20 seconds
C) 40 seconds
D) 60 seconds

Q53) The BDR, like the DR, maintains a full set of adjacencies on a broadcast link.
A) true
B) false

Q54) Which two protocols use the OSPF nonbroadcast mode by default?
A) PPP
B) HDLC
C) X.25
D) ATM
E) SLIP

Q55) Which two modes require a DR? (Choose two.)
A) point-to-point
B) broadcast
C) point-to-multipoint
D) nonbroadcast

Q56) Which two statements regarding the OSPF nonbroadcast mode are correct? (Choose
two.)
A) requires manual neighbor commands
B) does not use a DR and BDR
C) uses a DR and BDR
D) requires multiple subnets

Q57) When you are using an OSPF neighbor command, you must configure it under an
interface.
A) true
B) false

Q58) Which OSPF mode requires neighbor commands?
A) broadcast
B) point-to-point
C) point-to-multipoint
D) point-to-multipoint nonbroadcast

Q59) You have a partially meshed hub-and-spoke Frame Relay network. You consider using
the ip ospf network broadcast command on the Frame Relay interface because you do
not want to configure neighbor router statements. Is this a good idea?
A) yes
B) no

Q60) Which three benefits are derived from a multiarea design in OSPF? (Choose three.)
A) reduced LSA flooding
B) reduced SPF calculations
C) reduced size of the neighbor table
D) reduced size of the routing table

Q61) Which router is not an OSPF router type?
A) backbone
B) ABR
C) ASBR
D) core

Q62) List the four link types that a type 1 LSA defines.
A) ___point to point_____________
B) ____transit____________
C) ____stub____________
D) _____virtual___________

Q63) Match each LSA name with the number that corresponds to its LSA type.
A) external
B) network
C) summary
D) multicast
E) router
F) opaque
G) NSSA
_____ 5
_____ 2
_____ 3 and 4
_____ 6
_____ 1
_____ 9–11
_____ 7

Q64) Which of the following is NOT described in the output of the show ip ospf database command?
A) advertising router
B) maximum age counter
C) link count
D) LSA type
E) link type

Q65) If the OSPF routing table shows an O E1 route, what does this mean?
A) It is an interarea route that uses the external cost plus the interarea cost.
B) It is an interarea route that uses the external cost only.
C) It is an external route that uses the external cost only.
D) It is an external route that uses the external cost plus the internal cost.

Q66) Which two LSAs describe intra-area routing information? (Choose two.)
A) summary
B) external 1
C) external 2
D) router
E) network

Q67) Where will a type 3 LSA be sent?
A) only within the area it originates from
B) within the area it originates from plus the backbone area
C) within the area it originates from plus all other areas
D) within the backbone area plus all other areas

Q68) An O E1 route sums up the external metric and the interarea metric, while the O E2
route uses the external metric only. The O E1 route is the default for OSPF; the router
must be configured to support O E2.
A) true
B) false

Q69) A network uses Gigabit Ethernet and you want OSPF to correctly calculate the metric
using bandwidth. Which command should you use to ensure that this happens?
A) ip ospf cost on the interface
B) auto-cost reference-bandwidth under the OSPF routing process
C) bandwidth under the interface
D) bandwidth under the OSPF routing process

Q70) Looking at the routing table, you notice “[110/55].” What does this mean?
A) The O E1 cost is 110, and the O E2 cost is 55.
B) The administrative distance is 110, and the metric is 55.
C) The administrative distance is 55, and the metric is 110.
D) The total cost of the route is 165.

Q71) What does it mean if a route in the routing table has an indicator of O?
A) It is intra-area.
B) It is interarea.
C) It is external.
D) It is stub.

Q72) What is the difference between an LSA 3 and an LSA 4?
A) LSA 3 is a summary LSA, and LSA 4 is E1.
B) LSA 3 is E1, and LSA 4 is a summary.
C) LSA 3 is a summary for networks, and LSA 4 is a summary for ASBRs.
D) LSA 3 is a summary for ASBRs, and LSA 4 is a summary for networks.

Q73) By default, OSPF assigns a cost of 1 to a bandwidth of _____.
A) T1
B) 1 Gbps (gigabits per second)
C) 100 Mbps (megabits per second)
D) 10 Gbps

Q74) The OSPF LSDB shows an LSA with an age of 1799. What does this mean?
A) The LSA is going to age out in 1 second.
B) It has been 1799 minutes since the last update.
C) The LSA will be refreshed in 1 second.
D) The LSA was just refreshed, and another refresh is coming in 29 minutes and
59 seconds.

Q75) Summary LSAs are not automatically summarized.
A) true
B) false

Q76) What are the two reasons why route summarization is important? (Choose two.)
A) reduces LSA type 1 flooding
B) reduces LSA type 3 flooding
C) reduces the size of the routing table
D) reduces the size of the neighbor table

Q77) Which two features play a key role in route summarization? (Choose two.)
A) network numbers in areas should be assigned contiguously
B) network numbers in areas should be assigned discontiguously
C) FLSM
D) VLSM=

Q78) Which command would you use to summarize routes into area 0 from the ABR?
A) summary-address
B) area x range
C) network
D) area x summary

Q79) Which command would you use to summarize routes into OSPF from the ASBR?
A) summary-address
B) area x range
C) network
D) area x summary

Q80) A default route is identified in the OSPF database as an _____.
A) LSA type 1
B) LSA type 2
C) LSA type 3
D) LSA type 4
E) LSA type 5

Q81) The primary purpose of a default route is to reduce the routing table and LSDB size. A
default route avoids detailed updating of routes by inserting a single 0.0.0.0 into the
routing table, making this 0.0.0.0 route act as a gateway of last resort.
A) true
B) false

Q82) When should you use the always keyword with the default-information originate command?
A) on by default; configuration not required
B) when you want to send summarized routes
C) when your default route is always in the routing table
D) when you want the default route advertised, even if it is not in the routing table

Q83) Default routes must always be O E2 routes; there is no other choice.
A) true
B) false

Q84) A summary LSA (type 3 LSA) is designed to automatically summarize a network into blocks.
A) true
B) false

Q85) Route summarization reduces the flooding of which two of the following LSA types?
(Choose two.)
A) router
B) network
C) summary
D) external
E) NSSA

Q86) You are at the ABR of area 1 and want to classfully summarize network 172.16.32.0
through 172.16.63.0 into area 0. Write the configuration command that you would use.
area 1 range 172.16.0.0 255.255.0.0

Q87) You are at the ASBR between an OSPF area 0 and an EIGRP network. EIGRP routes
are being redistributed into OSPF. Write the correct summarization command to
summarize the EIGRP block 172.16.32.0 through 172.16.63.0.
summary-address 172.16.32.0 255.255.224.0

Q88) It is important to always summarize the routes from area 0 into other areas. Suboptimal
path selection can occur if you do not.
A) true
B) false

Q89) The area range command has an optional not-advertise parameter, which is used to prevent advertising _____.
A) all summary LSAs into area 0
B) summary LSAs that match the area range command
C) all external LSAs
D) external LSAs that match the area range command

Q90) Generally, a default route is described in the routing table as an _____.
A) O route
B) O IA route
C) O *E1 route
D) O *E2 route

Q91) Which command is best to use if you want to establish a default route from a router that has no default route in its routing table?
A) ip route 0.0.0.0 0.0.0.0 next hop address
B) default-information originate
C) default-information originate always
D) static route

Q92) The area x range and network commands are similar because both use inverse masks for configuration purposes.
A) true
B) false

Q93) A default route is a form of route summarization.
A) true
B) false

Q94) Which is NOT permitted in a stub area?
A) an ABR
B) an ASBR
C) summary routes
D) summary LSAs

Q95) Which type of router advertises the default into a stub area?
A) ASBR
B) backbone router
C) ABR
D) internal router

Q96) What is the correct configuration for stub area 10?
A) area 10 stub-area
B) router ospf 10 stub
C) area 10 stub
D) area 10 stub no-summary

Q97) What is the meaning of the no-summary parameter of the area x stub command?
A) There is no route summarization in the stub area.
B) No summary LSAs are sent into the stub area.
C) No type 5 LSAs are sent into in the stub area.
D) There are no external LSAs in the stub area.

Q98) The default route has a cost of 1 from the stub area ABR if no area default-cost command is used.
A) true
B) false

Q99) Which characteristic relates to NSSA?
A) allows stub area benefits without meeting stub area requirements
B) is a Cisco proprietary technique
C) allows ASBRs but not virtual links
D) floods LSA type 7 into the backbone area

Q100) A disadvantage of NSSA is that it does not have a totally stubby feature like a normal stub area.
A) true
B) false

Q101) Which characteristic is not a prerequisite for stub areas?
A) virtual links not allowed
B) ASBRs not allowed
C) ABRs not allowed
D) one way in and out of the stub area

Q102) Stub area design will not improve _____.
A) CPU utilization on routers in the stub
B) memory requirements on routers in the stub
C) ability to reach outside networks
D) LSDB size on routers in the stub

Q103) An LSA type 7 appears in the routing table as an _____.
A) O E1 route
B) O E2 route
C) O N2 route
D) O I/A route

Q104) What is the difference between stub area and totally stubby area configuration?
A) no-summary option at the ABR
B) area area-id totally-stubby command at the internal routers
C) area area-id nssa command at the internal routers
D) default-cost command at the ABR

Q105) A stub area blocks summary LSAs (type 3 and 4 LSAs).
A) true
B) false

Q106) Where should you configure the area area-id stub command when you are configuring a stub area?
A) on all routers in the area
B) on the ABR
C) on the ASBR
D) on routers that require stub capability within the area=

Q107) Which two features are specific to Cisco? (Choose two.)
A) stub areas
B) totally stubby areas
C) NSSA
D) totally stubby NSSA

Q108) In NSSA, the NSSA ABR translates type 7 LSAs into type 5 LSAs.
A) true
B) false

Q109) The ABR injects a default route into which three types of areas? (Choose three.)
A) stub
B) totally stubby NSSA
C) totally stubby
D) area 0

Q110) Which two types of authentication are used in OSPF? (Choose two.)
A) MD5
B) encrypted password
C) simple password
D) MD6

Q111) When OSPF authentication is configured between two routers, each router has its own
unique password.
A) true
B) false

Q112) Which three of the following are used to generate the message digest when OSPF MD5
authentication is configured?
A) packet
B) sequence number
C) key ID
D) key
E) router ID

Q113) Which command is used to specify that OSPF simple password authentication is to be used?
A) ip ospf authentication simple
B) ip ospf authentication
C) ip ospf authentication-key
D) ip ospf message-digest-key
E) ip ospf authentication message-digest

Q114) Which command is used to specify that OSPF MD5 authentication is to be used?
A) ip ospf authentication simple
B) ip ospf authentication
C) ip ospf authentication-key
D) ip ospf message-digest-key
E) ip ospf authentication message-digest

Q115) When a new MD5 key is configured on a router for OSPF authentication, it will use
both the old and new key until the new key is configured on neighboring routers.
A) true
B) false

Q116) Which command is used to troubleshoot OSPF authentication?
A) debug ip ospf adj
B) debug ip ospf adjacency events
C) debug ip ospf database
D) debug ip ospf packets


117) A router chooses the Router ID based on which of the following?
The Router ID is determined by the highest IP address configured
on a loopback interface. If a router does not have a loopback interface,
then the Router ID is determined by the highest IP address configured
on the router.

118) What are the three areas of OSPF operation? (Choose three.)
B. SPF calculation
C. LSA flooding
D. Neighbor discover and adjacency formation

119) Which of the following is the IOS command to set the cost on an OSP interface?
The IOS command to set the cost of an OSPF interface is ip ospf
cost cost, where cost is a number from 1 to 65,535.

120) In what type of topology do all routers have a virtual connection to all other routers?
A. Full-mesh

121) What does an OSPF neighbor status of down mean?
D. No Hello packets have been received on the interface.

122) What does the OSPF neighbor status init mean?
The init state is simply the state of receiving Hello packets on thevinterface; no adjacencies or other information have been exchanged at this point.

123) What does the OSPF neighbor status 2Way mean?
Hello packets contain Router ID information. Once a router sees its own Router ID, it is in a 2Way state.

124) What does the OSPF neighbor status ExStart mean?
ExStart is the step prior to exchanging all route information. LSA floods occur for routing updates after adjacencies have been formed.

125)What does the OSPF neighbor status Loading mean?
This process follows the Exchange state and verifies that no new LSA information became available during the exchange process.

126) What does the OSPF neighbor status Exchange mean?
Although there are continuous route exchanges, the Exchange state occurs at the time adjacencies are established.

127) What does the OSPF neighbor status Full indicate?
When a neighbor reaches Full status, it has synchronized its database with all of the adjacent routers.

128) Which of the following network types have a DR and a BDR assigned?
A. Broadcast
C. NBMA broadcast

129) Which routers form adjacencies with routers designated as DROther
on a broadcast multi-access network? (Choose all that apply.)
B. BDR
C. DR

130) Which IP multicast address corresponds with AllSPFRouters?
B. 224.0.0.5

131) Which of the following OSPF terms refers to a connected (or adjacent) router that is running an OSPF process, with the adjacent interface assigned to the same area?
B. Neighbor

132) What is the valid range for the cost metric for OSPF interfaces?
A. 1–255

133) Which method does Cisco use to calculate the cost of a link?
A. 1 x 108 / bandwidth

134) What OSPF term refers to a network or router interface assigned to
any given interface?
A. Link

135)  All OSPF networks must contain which of the following?
B. Area 0

136) Which of the following are advantages of OSPF over RIP? (Choose all that apply.)
A. Speed of convergence
C. Support for VLSMs
D. Scalability

Tuesday, September 2, 2014

Routing MCQ

Q1) Which three situations might require multiple routing protocols in a network? (Choose three.)
A) when a new Layer 2-only switch is added to the network
B) when you are migrating from one routing protocol to another
C) when you are using routers from multiple vendors
D) when there are host-based routers from multiple vendors

Q2) Which two routing protocols can be redistributed into OSPF by a Cisco router? (Choose two.)
A) IP EIGRP
B) Appletalk EIGRP
C) RIPv2
D) IPX RIP

Q3) Which is a reason for avoiding doing route redistribution on two routers between the same two routing domains?
A) higher cost of two routers
B) routing feedback
C) Cisco IOS incompatibility
D) not possible to use two routers

Q4) The subnet keyword is required when you are redistributing subnet routes into which routing protocol?
A) OSPF
B) RIP
C) EIGRP
D) IS-IS

Q5) Which two actions does issuing the passive-interface command prevent? (Choose two.)
A) prevents routing updates from being sent out an interface but not from being received on an interface
B) prevents routing updates from being sent out an interface and also from being received on an interface
C) prevents link-state protocols and EIGRP from sending hellos out the interface
D) prevents the exchange of routing updates only, not hellos

Q6) Which statement does not describe route map operation?
A) Routes maps use a top-down processing scheme.
B) Route maps use match and set logic to match a metric and then set which route is redistributed
C) Route maps are line-numbered for easier editing.
D) Route maps use an implicit deny at the bottom of the map, just like access lists.

Q7) When you are configuring a route map, you must define a map tag. How is a map tag used?
A) to tag a route in a set command
B) to match on a tagged route in a match command
C) to deny routes from being redistributed
D) to give a name to the route map

Q8) What does administrative distance rank?
A) metrics
B) sources of routing information
C) router reliability
D) best paths

Q9) DHCP is structured to use which two well-known UDP ports? (Choose two)
A) BOOTPS
B) TFTP
C) DNS
D) BOOTP

Q10) A request for address assignment is initiated by which device?
A) client
B) relay agent
C) router
D) DHCP server

Q11) What is the purpose of the Cisco IOS global command ip dhcp pool [pool name]?
A) to define the inside global address pool for NAT
B) to define a range of IP addresses to be assigned by the router acting as a DHCP server
C) to define exceptions to the IP addresses to be assigned
D) to enable global route summarization


BGP MCQ

Q1) On what does BGP base the selection of the best path?
A) speed
B) AS routing policy =
C) number of routers to reach a destination network
D) bandwidth plus delay

Q2) Which routing method best describes BGP?
A) distance vector
B) link-state
C) path-vector=
D) hybrid of link-state and distance vector

Q3) Which two conditions are valid reasons to run BGP in an AS? (Choose two.)
A) The AS is an ISP.=
B) The AS has only a single connection to another AS.
C) Path and packet flow manipulation is required in this AS.=
D) You have a limited understanding of BGP routing and route filtering.

Q4) Which BGP message establishes a BGP session and carries the hold time and the BGP router ID?
A) BGP update message
B) BGP keepalive message
C) BGP open message =
D) BGP notification message

Q5) Which two characteristics are true for BGP? (Choose two.)
A) supports VLSM=
B) supports CIDR=
C) is an IGP
D) is not used for routing between autonomous systems

Q6) Which two statements are true for BGP route advertisements and path selection?
(Choose two.)
A) BGP selects the best path based on speed.
B) BGP routers exchange attributes.=
C) BGP advertises paths.=
D) BGP paths are not loop-free.

Q7) Which protocol does BGP use?
A) UDP port 520
B) TCP port 179=
C) IP protocol number 88
D) IP protocol number 89

Q8) Which component does a BGP update contain?
A) multiple paths and multiple networks
B) a single path and multiple networks=
C) a single path and a single network
D) multiple paths and a single network

Q9) Which BGP message is sent when an error condition is detected?
A) BGP update message
B) BGP keepalive message
C) BGP open message
D) BGP notification message=
E) BGP error message

Q10) What are three common ways to perform multihoming? (Choose three.)
A) Each ISP passes only a default route to the AS.=
B) Each ISP passes a default route and provider-owned specific routes to the AS.=
C) Each ISP passes selected provider-owned routes but no default route to the AS.
D) Each ISP passes all routes to the AS.=


Q11) Which two terms refer to routers that are configured to exchange BGP information with
one another?
A) BGP peer=
B) BGP speaker
C) BGP router
D) BGP neighbor=


Q12) By default, which two are conditions for routers to be EBGP neighbors? (Choose two.)
A) directly connected=
B) in the same AS
C) in different autonomous systems=
D) running an IGP between them to establish an adjacency


Q13) What are three ways to form an adjacency between IBGP neighbors by default?
(Choose three.)
A) The neighbors can be directly connected.=
B) The neighbors can be reachable from one another by static routes.=
C) The neighbors can be reachable from one another by a dynamic internal routing protocol.=
D) The neighbors can be in different AS.

Q14) Which statement about BGP is true?
A) Routes learned via IBGP are never sent to EBGP peers.
B) All the routers between IBGP neighbors must not be running BGP.
C) Routes learned via IBGP are never propagated to other IBGP peers.=
D) Routes are never learned via IBGP.

Q16) Which command indicates to a BGP router whether an IP address belongs to an IBGP
or an EBGP neighbor?
A) neighbor {ip-address | peer-group-name} shutdown
B) neighbor {ip-address | peer-group-name} update-source interface-type
interface-number
C) neighbor {ip-address | peer-group-name} remote-as autonomous-system=
D) neighbor {ip-address | peer-group-name} next-hop-self


Q17) Which command sets the source IP address of a BGP update to be the IP address of a
specific interface?
A) neighbor {ip-address | peer-group-name} shutdown
B) neighbor {ip-address | peer-group-name} update-source interface-type
interface-number=
C) neighbor {ip-address | peer-group-name} remote-as autonomous-system
D) neighbor {ip-address | peer-group-name} next-hop-self

Q18) Which one of these BGP network statements is valid?
A) network 199.199.199.199 mask 255.255.255.0
B) network 191.200.100.0
C) network 172.16.1.0 mask 255.255.0.0
D) network 200.100.50.0=

Q19) Which state indicates that the router does not have a path to the neighbor IP address?
A) active
B) idle=
C) established
D) open confirm

Q20) Which state indicates that an open message has been sent but a reply has not been
received from the neighbor in more than 5 seconds?
A) active=
B) idle
C) established
D) open confirm

Q21) Which command is the most disruptive method of resetting BGP sessions and should
be avoided?
A) clear ip bgp 192.168.200.1
B) clear ip bgp *=
C) clear ip bgp 192.168.200.1 soft in
D) clear ip bgp 192.168.200.1 soft out

Q22) Which command resends the routing table without resetting the TCP session and flags
routes that the neighbor, 192.168.200.1, will not see anymore as “withdrawals”? (You
should use this command if the outbound policy of a BGP router has changed.)
A) clear ip bgp 192.168.200.1
B) clear ip bgp *
C) clear ip bgp 192.168.200.1 soft in
D) clear ip bgp 192.168.200.1 soft out=

Q23) Which command is used to administratively disable a BGP neighbor?
A) neighbor {ip-address | peer-group-name} shutdown=
B) neighbor {ip-address | peer-group-name} update-source interface-type
interface-number
C) neighbor {ip-address | peer-group-name} remote-as autonomous-system
D) neighbor {ip-address | peer-group-name} next-hop-self

Q24) Which command sets the next-hop address to be the source IP address of the update
when advertising to a BGP neighbor?
A) neighbor {ip-address | peer-group-name} shutdown
B) neighbor {ip-address | peer-group-name} update-source interface-type
interface-number
C) neighbor {ip-address | peer-group-name} remote-as autonomous-system
D) neighbor {ip-address | peer-group-name} next-hop-self=

Q25) Which clear ip bgp command is the least intrusive for resetting a BGP session after
changing outbound policy for neighbor 200.100.50.1?
A) clear ip bgp *
B) clear ip bgp 200.100.50.1 soft out=
C) clear ip bgp 200.100.50.1
D) clear ip bgp 200.100.50.1 soft in

Q26) The network command that is used in the router BGP process identifies the interfaces
out of which to advertise BGP updates.
A) true
B) false=

Q27) A BGP router automatically peers with any other BGP router.
A) true
B) false=

Q28) Which BGP neighbor state is the proper state for normal BGP neighbor operations?
A) active
B) open confirm
C) idle
D) established=

Q29) Which command resets the TCP session only between a router and its neighbor,
192.168.200.1?
A) clear ip bgp 192.168.200.1=
B) clear ip bgp *
C) clear ip bgp 192.168.200.1 soft in
D) clear ip bgp 192.168.200.1 soft out

Q30) In the output of the show ip bgp command, what does the “s” in front of the line for a
network mean?
A) summarized network
B) subnet of a network
C) suppressed network=
D) supernet of a network

Q31) When authenticating between two BGP routers, the same password must be configured
on both routers.
A) true=
B) false

Q32) Which description applies to the AS path attribute?
A) well-known mandatory=
B) well-known discretionary
C) optional transitive
D) optional nontransitive

Q33) Which description applies to the next-hop attribute?
A) well-known mandatory=
B) well-known discretionary
C) optional transitive
D) optional nontransitive

Q34) Which description applies to the origin attribute?
A) well-known mandatory=
B) well-known discretionary
C) optional transitive
D) optional nontransitive

Q35) Which description applies to the local preference attribute?
A) well-known mandatory
B) well-known discretionary=
C) optional transitive
D) optional nontransitive

Q36) Which description applies to the MED attribute?
A) well-known mandatory
B) well-known discretionary
C) optional transitive
D) optional nontransitive=

Q37) Which description applies to the weight attribute?
A) well-known mandatory
B) well-known discretionary
C) optional transitive
D) proprietary to Cisco and not advertised to other BGP routers=

Q38) BGP, by default, will load-balance across how many paths?
A) 1=
B) 2
C) 4
D) 6

Q39) Which path will BGP prefer when using the weight attribute?
A) higher weight=
B) lower weight

Q40) Which path will BGP prefer when using the local preference attribute?
A) higher local preference=
B) lower local preference

Q41) Which path will BGP prefer when using the MED attribute?
A) higher MED
B) lower MED=


Q43) Place the BGP selection criteria in order from the first step to the last step evaluated to
select the BGP path that is submitted to the IP routing table.
A) _____ prefer the path with the lowest neighbor BGP router ID 10
B) _____ prefer the lowest MED 6
C) _____ prefer the shortest AS path 4
D) _____ prefer the oldest route for EBGP paths 9
E) _____ prefer the lowest origin code (IGP < EGP < incomplete) 5
F) _____ prefer the highest weight 1
G) _____ prefer the path through the closest IGP neighbor 8
H) _____ prefer the highest local preference 2
I) _____ prefer the route that was originated by the local router 3
J) _____ prefer an EBGP path over IBGP path 7
K) _____ prefer the lowest neighbor IP address 11


Q44) Which two statements are true regarding local preference? (Choose two.)
A) The higher value for local preference is preferred. =
B) Local preference is used only between EBGP neighbors.
C) The lower value for local preference is preferred.
D) Local preference is used only between IBGP neighbors.=

Q45) Which two statements are true regarding the MED? (Choose two.)
A) The higher value for the MED is preferred.
B) The MED is exchanged between autonomous systems.=
C) The lower value for the MED is preferred.=
D) The MED is local to an AS.

Q46) Which command changes the MED for all routes?
A) bgp med number
B) default-metric number=
C) default-med number
D) set med number
E) bgp default-metric number

Q47) Which command is used within a route map to change the local preference value?
A) bgp default local-preference value
B) default local-preference value
C) set local-preference value=
D) set metric value

48. What are the benefits of using a link-state routing protocol? (Choose all that apply.)
A. It uses the Hello packet to establish adjacencies.=
B. It uses several components to calculate the metric of a route.
C. Updates are sent only when changes occur in the network.=
D. It is a better protocol than distance-vector is.

49. BGP is used to advertise which of the following?
A. Network hosts
B. Network paths=
C. Network switches
D. Network servers

50. Which of the following RFCs explains autonomous systems as a set of routers under one or more administrations that present a common
routing policy to the Internet?
A. RFC 1930=
B. RFC 2047
C. RFC 2047
D. RFC 31

51. Which of the following is not an IGP?
A. RIPv2
B. IGRP
C. IPv4=
D. OSPF

52. Which of the following BGP types runs outside of an AS?
A. oBGP
B. iBGP
C. eBGP=
D. xBGP

53. Interior routing protocols operate at what layer of the OSI Reference Model?
A. Shared layer
B. Network layer=
C. Data Link layer
D. Physical layer
E. Routing layer

54. When an AS must traverse another AS to get to its destination, the traversed AS is called which of the following?
A. Complete AS
B. Forwarding AS
C. Transit AS=
D. Transistor AS

55. BGP uses which of the following TCP ports to open a session with another BGP peer?
A. Port 20
B. Port 21
C. Port 80
D. Port 179=


56. Which of the following message types must be sent by a BGP peer during the configured hold time to keep a session from terminating?
(Choose the two best answers.)
A. Non-terminate message
B. KEEPALIVE message=
C. UPDATE message=
D. TIMER message

57. Which of the following authorities is responsible for assigning ASNs?
A. ANSI
B. Internet Police
C. IEEE
D. IANA=

58. An autonomous system number is comprised of how many bits?
A. 8
B. 16=
C. 32
D. 64

59. How many entry and exit points can be found in a stub network?
A. Five
B. Four
C. Two
D. One=


60. When a BGP peer tries to open a session with another endpoint, the peer is in which of the following states?
A. Active state
B. Connection state =
C. Open state
D. Established state

This peer is in the Connection state until a message is sent to identify each peer. When the connection is established, it transitions to the
Open state. Once the other peer accepts the connection, the peer transitions to Established state. If the connection is lost, possibly due to a
version mismatch, the peer goes to the Active state and actively tries to reestablish the connection using the proper version properties.

61. Withdrawn routes are advertised in which of the following message types?
A. OPEN
B. UPDATE =
C. NOTIFICATION
D. KEEPALIVE

62. Which of the following attributes must be included in a BGP UPDATE message?
A. Well-known mandatory=
B. Well-known discretionary
C. Optional transitive
D. Optional non-transitive
E. All of the above

63. Which of the following is not a well-known mandatory attribute?
A. AS_PATH
B. COMMUNITIES=
C. ORIGIN
D. NEXT_HOP


64. Which of the following attributes is considered to be BGP’s extensive route-selection component?
A. ORIGINATOR_ID
B. MULTI_EXIT_DISCRIMINATOR=
C. CLUSTER_LIST
D. AS_PATH

65. The Network Layer Reachability Information (NLRI) field is used to identify prefixes associated with which of the following fields found in
an UPDATE message?
A. CLUSTER_LIST
B. MED
C. Total Path Attributes=
D. ORIGINATOR_ID

The NLRI field shows route prefixes with attributes identified in the Total Path Attributes field. The other answers listed are all
attributes found in the Total Path Attributes field.

66. Which of the following fields is not found in a BGP common header?
A. Marker
B. Length
C. Version=
D. Type

The Version field is not found in a BGP common header. If the common header specifies this to be a BGP OPEN message, then the
Version field will be found in the message but not in the BGP common header.

67. Which of the following is not a BGP message type?
A. OPEN
B. UPDATE
C. NOTIFICATION
D. KEEPALIVE
E. WAIT =
F. All of the above.

There is no WAIT message type. The OPEN message type is used to establish a connection between BGP peers. The NOTIFICATION
message type is used to advertise errors. The UPDATE message type is used to advertise topology updates and changes, and the KEEPALIVE
message type is sent to keep a session active when no UPDATE messages are exchanged during the established hold time.

Tuesday, August 26, 2014

Route Redistribution Notes

Route Redistribution Overview
=============================
Redistribution occurs from the routing table not the routing database
When redistributing protocol X into Y, take
-routes in the routing table via protocol X
-connected interfaces running protocol X

Route advertisement rules
-RIP vs EIGRP vs OSPF vs BGP

Connected Redistribution
=====================
Implicitly occurs for connected links running the redistributed protocol
Additional connected links can explicitly included or excluded
-redistribute connected [metric] ][route-map]
-overrides implicit redistribution

How IOS chooses Path
=======================
Routing database chooses one or more candidate paths
-EIGRP via DUAL, OSPF via SPF, etc
-Load-balancing possible via maximum-paths

IF multiple equal matches between protocols
-choose the lower AD

Install results in RIB and/or FIB

Administrative Distance Values
======================
0 : connected
1 : static
5 : EIGRP summary
20 : External BGP
90 : Interal EIGRP
110 : OSPF
115 : IS-IS
120 : RIP
160 : ODR
170 : External EIGRP
200 : Internal BGP
255 : Infinite

RIP Redistribution
=================
Doesn’t differentiate between internal and external routes
-AD of 120 for all routes
No default seed metric
-redistribute [protocol] metric [hops]
-default-metric [hops]

EIGRP redistribution
===================
AD of 170 for external EIGRP
-helps to automatically prevent route feedback
Uses router-id for loop prevention
No default seed metric unless EIGRP to EIGRP
-redistribute [protocol] metric [bw] [delay] [load] [relaibility] [mtu]
-default-metric [“”]

OSPF redistribution
==================
AD of 110 for all OSPF routes
Uses Router-ID for flooding loop prevention
Default seed metric 20 and metric-type E2/N2
OSpf path selection preference
-E1>E2>N1>N2
-E1 & N1 vs E2 & N2 metrics

BGP redistribution
=================
Uses ORIGIN code incomplete (?)
Normal EBGP and IBGP loop prevention
IGP to BGP
-denies ospf external by default
.redistribute ospf [pid] match internal external
BGP to IGP
-EBGP routes allowed, iBGP routes denied by default
.bgp redistribute-internal
.legacy synchronization rule

.can cause routing loop

OSPF Notes

OSPF Overview
==========
Classless link-state protocol
-uses Dijkstra SPF algorithm
-maintains active adjacencies
-supports VLSM
-supports both topology and NLRI summarization

Enabling OSPF
===============
Enable the global process
-router ospf [process-id]
.process-id is locally significant
-Must be an up/up interface running IP
.used for OSPF Router-ID
Enable the interface process
-network [address] [wildcard] area [area]
-ip ospf [process-id] area [area]

Verifying OSPF
===============
Verify OSPF is enabled
-show ip ospf
-show ip ospf interface [brief]
Verify OSPF adjacency's
-show ip ospf neighbor
-show ip ospf adj
Verify ospf database
-show ip ospf database [router | network | summary]

Neighbor and Topology Discovery
==========================
Like EIGRP, OSPF use hello packets to discover neighbors
-transport via IP protocol 89 (OSPF)
-sent as multicast to 224..0.0.5 or 224.0.0.6 or unicast
Hello packets contain attributes that neighbors must agree on to form adjacency
Once adjacency is negotiated, LSDB is exchanged.

Negotiating OSPF Adjacencies
========================
Neighbors must agree on attributes to form adjacency
-Not all ospf neighbors actually form adj
-most ospf configuration problems happen at this stage
Unique attributes include…
-local Router-id
-local interface ip address

Negotiating OSPF adjacencies
========================
Common attributes include…
-interface area-id
-hello interval and dead interval
-interface network address
-interface MTU
-network Type
-Authentication
-stub flags
-other optional capabilities

OSPF Media Dependencies
=======================
OSPF  behavior changes based on media
-eg Ethernet vs FR vs PPP
Different media uses different “network types “ to control..
-how updates are sent
-who forms adjacency
-how next-hop is calculated

OSPF Network Types
=================
Broadcast
Non-broadcast
Point-to-point
Point-to-multipoint
Point-to-multipoint nonbroadcast
Loopback

OSPF Network Broadcast
====================
Ip ospf network broadcast
Default on multi-access broadcast medias
-ethernet, token ring, & FDDI
Sends hellos and updates as multicast
-224.0.0.5 (AllSPFRouters)
-224.0.0.6 (All DR Routers)
Performs DR and BDR election

DR/BDR Overview
====================
Designated Router (DR)
-used on broadcast links to
.minimize adjacencies
.minimize LSA replication
Backup DR
-used for redundancy of DR
DROthers
-All other routers on link
-form full adjacency with DR & BDR
-stop at 2way adj with each other
DR/BDR choosen through election process

DR/BDR election
===================
Election based on the below field present in hello packets
-priority
0-255
Higher better
0 = never
-Router-id
.Highest loopback/interface Ip
.can be statically set
.higher better
.No preemption unlike IS-IS’s DIS

OSPF Network Non-Broadcast
======================
Ip ospf network non-broadcast
Default on multipoint NBMA medias
-FR & ATM
Sends hellos as unicast
-manually defined addresses with neighbor command
-performs DR/BDR election

OSPF Network Point-to-multipoint
==========================
Ip ospf network point-to-multipoint
Treats network as a collection of point-to-point links
Sends hellos as multicast
-224.0.0.5
No DR/BDR election
Special next-hop processing
Usually the best design option for partial mesh NBMA networks

OSPF network Point-to-point
======================
ip ospf network point-to-point
Default on point-to-point medias
-HDLC/PPP
Sends hellos as multicast
-224.0.0.5
No DR/BDR election
Supports only two neighbors on the link

Point to multipoint Non-broadcast
===========================
Ip ospf network point-to-multipoint non-broadcast
Same as point-to-multipoint, but sends hellos as unicast
-manually defined addresses with neighbor command
-allows for per-VC OSPF cost over NBMA
No DR/BDR election
Special next-hop processing

OSPF Network Loopback
===================
Special case for loopback and looped-back interfaces
Advertises link as /32 stub host route
Ip ospf network point-to-point (used to disable loopback)

OSPF PATH Selection
=================
Once databases are synchronized, path selection begins
Each router’s LSA include a “cost” attribute for each described link
Best path to that link is lowest end-to-end cost
Cisco’s implementation uses bandwidth based cost, but per RFC it is arbitrary
-default cisco cost = 100 Mbps/Link BW
-reference bandwidth can be modified to accommodate higher speed links (eg GigE)

OSPfF path selection order
============================
Per RFC, ospf path selection state machine prefers..
-Intra area routes (O)
-Inter area routes (O IA)
-External Type 1 (E1)
-External Type 2 (E2)
-NSSA Type 1 (N1)
-NSSA Type 2 (N2)
Cannot be modified with metric or distance.

Modifying OSPF path selection
=============================
Ospf uses bandwidth based cost
-COST = ref BW/Interface_BW
Cost can be modified with
-interface bandwidth
-interface ip ospf cost
-process auto-cost
-process neighbor [address] cost

OSPF convergence Timers
======================
Convergence based on hello and dead timer
-supports sub-second timers
Different timers for different network types
-show ip ospf interface
Changing hello time automatically adjusts dead time
-ip ospf hello-interval
-ip ospf dead-interval
Note: bidirectional forwarding detection is used for L2 link failures in ospf when we use switches in between routers.

OSPF Authentication
====================
OSPF supports 3 types of authentication
-0 = Null
-1 = clear test
-2 = MD5
Can be enabled
-on all links in the area (ie configured on a process)
-on a per link basis
Key is always applied at link level
-virtual-links are area 0 interfaces

OSPF Summarization
======================
All devices within the area must have the same LSDB
Implies summarization can only occur
-between areas
.area [source area] range [address] [mask]
-during redistribution
.summary-address [address] [mask]
Automatically generates discard route
-disabled with no discard route [internal | external]
Can be used for TE via longest match routing

OSPF Filtering Overview
====================
OSpf is a link-state routing protocol
-to calculate identical SPTs everyone must have the same input to SPF(the LSDB)
-Implies that filtering cannot be configured within an area
Inter-area filtering through
-stub areas
-LSA 3 filter

OSPF Stub Areas
=================
Stub areas used to limit type of LSAs allowed to enter an area
-Intra Area routes (O)
.LSA 1 & 2
Inter area routes (O IA)
.LSA 3 & 4
-External routes (E1 & E2)
.LSA 5
-NSSA external routes (N1 & N2)
.LSA 7

All routers in an area must agree on the stub flag

OSPF Stub Areas
===========
Stub Area
-removes external routes (LSA 5)
-removes ASBR advertisement (LSA 4)
-ABR originates inter-area default route (LSA 3)

Enabled on all routers in an area
-area [area id] stub

OSPF Stub Areas
============
Totally stub Area
-removes external routes (LSA 5)
-removes ASBR advertisement (LSA 4)
-removes inter-area routes (LSA 3)
-ABR orginates inter-area default route (LSA 3)

Stub enabled on all routers in the area
-area [area] stub

Totally stubby enabled on ABR(s) of the area
-area [area] stub no-summary

OSPF Stub Areas
=============
Not-so-stubby area (NSSA)
-allows NSSA external generation (LSA 7)
-removes external routes (LSA 5)
-removes ASBR advertisement (LSA 4)

All routers must agree on NSSA
-area [area] nssa

ABR does not originate default automatically
-can be configured to generate LSA 7 default
-area [area] nssa default-information-originate

OSPF stub Areas
===============
Not-so-totally-stubby area
-allows NSSA external generation (LSA 7)
-removes external routes (LSA 5)
-removes ASBR advertisement (LSA 4)
-removes inter-area routes (LSA 3)
-ABR originates inter-area default route (LSA 3)

NSSA enabled on all routers in the area
-area [area] nssa

Totally stubby enabled on ABR(s) of the area
-area [area] nssa no-summary

Controlling NSSA Redistribution
============================
Redistributed routes on an NSSA router are originated as LSA 7
If NSSA ASBR is also an ABR..
-type 7 originated into NSSA
-type 5 originated into Area 0

Type 7 origination can be suppressed
-area [area] nssa no-redistribution
-send type 5 to area 0 but not type 7 to NSSA

NSSA Translator Election
================
NSSA ABR translates Type 7 LSAs into Type 5 for Area 0 advertisement
If multiple ABRs, only on of them performs translation
-NSSA translator election chooses ABR with the higher router-id
IF forwarding address is non-zero, ABR need not be in the transit path

LSA 3 Filter
==============
Stub areas can only filter on LSA type
ABRs can filter which summary LSAs (LSA 3) they generate between areas
Applied to process level of ABR
-area [area] filter-list prefix [prefix-list] [in | out]

-In/out allows for control of ABRs with more than 2 areas

Tuesday, August 5, 2014

BGP Notes

BGP Overview
============
Open Standards based
-RFC 4271 “ A border gateway protocol 4 (BGP-4)”
Classless path vector routing protocol
-uses multiple “attributes” for routing decision
-supports VLSM and summarization
-Extensible
 IPV4 Multicast, IPv6, MPLS, etc.

BGP ASNs
=============
Autonomous Systems (AS)
-a set of routers under a single technical administration, using an interior gateway protocol(IGP) and common metrics to determine how to route packets within the AS, and using an inter-AS routing protocol to determine how to route packets to other Ases.
ASNs are allocated by Internet assigned number authority (IANA)
Generally, BGP relies on ospf, ISIS, Eigrp to advertise routing within AS.

BGP ASN Values
================
Originally 2 byte field
-value 0-65535
-public  ASNs 1-64511
-private ASNs 64512-65535

Now 2 byte is already occupied so we come up with 4 byte AS

Currently 4-byte field
-BGP support for four-octet AS number space

4-Byte BGP ASN
==============
0.0   – 65535.65535 notation
-0.[0-65535] denote original 2 byte ASNs
Requires backwards compatibility with old code.
-4 byte ASN support negotiated during capability exchange
-old bgp speakers are sent ASdot numbers encoded as ASN “23456”
-real AS-Path encoded with optional transitive  attributes AS4_AGGREGATOR and AS4_PATH

Establishing BGP Peerings
=====================
Like IGP, the first step in BGP is to find neighbors to exchange information with
Unlike IGP..
-BGP does not have its own transport
-BGP has different types of neighbors
-BGP neighbors are not discovered
-BGP neighbors do not have to be connected
Since we have a TCP used as a L4 protocol(logical) for the establishment, hence neighbors in case of IBGP need not to be directly connected.

BGP Transport
================
BGP uses TCP port 179 for transport
-Implies that BGP needs IGP first
BGP neighbor statements tells process to
-listen for remote address via TCP 179
-initiate a session to remote address via TCP 179
-If collision, higher router-id becomes TCP client
Note: if you want to use BGP only then there should be a physical connection between all routers ie full mesh which has again routing issues. Hence we use IGP within IBGP for route recursion process to BGP next hop value.

BGP Peering Types
===============
External BGP (EBGP ) peers
-neighbors outside my AS
Internal BGP(iBGP) Peers
-neighbors inside my AS
Update and pacth selection rules change depending on what type of peer a route is being sent to/received from

BGP Peering Rules
===========
EBGP packets default to TTL 1
-Can be modified if neighbors are multiple hops away
.neighbor ebgp-multihop [ttl]
.neighbor ttl-security hops [ttl]
Nom multi-hop peers must be directly connected by default
-can be modified if connected neighbors peer via Loopbacks
.neighbor disable –connected-check

Loop prevention via AS-PATH
-Local ASN is prepended to outbound updates
-Inbound updates containing local ASN are discarded
-can be modified with neighbor allows-in

Next-hop processing
-outbound EBGP updates have local update-source for neighbor set as next-hop
Eg. If update-source is Loopback0, next –hop is loopback0
-Can be modified with route-map action set ip next-hop but typically shouldn’t
.eg third-party next-hop

Note: control plane = session = routing update
Data plane = data forwarding = actual data flow.
IBGP packets default to TTL 255
-implies neighbors do not have to be connected as long as IGP reachability exists
Loop prevention via route filtering
-iBGP learned routes cannot be advertised on to another IBGP neighbor
-Implies need for either..
.fully meshed iBGP peerings
.router reflection
.confederation

Next-hop Processing
===================
-Outbound iBGP updates do not modify the next-hop attribute regardless of IBGP peer type
.iBGP peer
.Route reflector’s client peer
.Route Reflector’s non-client peer
.Confederation EBGP peer
-Can be modified with neighbor next-hop-self on route-map action set ip next-hop
Note : in case of BGp control and data plane are disconnected which gives us a flexibility to route outbound traffic based on route-map.

BGP Transport
==============
TCP server must agree on where client’s session is coming from
-if server does not expect session it will refuse
Client’s packet is sourced from outgoing interface in the routing table.
-can be modified with update-source per neighbor

iBGP Route reflection
======================
Eliminates need of full mesh
-only need peering(s) to the RR(s)
Like OSPF DR & IS-IS DIS, minimizes prefix replication
-send one update to the RR
-RR sens the update to its “clients”
Loop prevention through Cluster-ID
-RR discards routed received with its own cluster-id
-does not modify other attributes such as next-hop

Route reflector Peerings
===================
Route reflector can have three types of peers
-EBGP peers
.neighbors in differnet AS
-Client peers
.IBGP peers with route-reflector-client
-Non-client  peers
.IBGP peers without route-reflector-client

Route Reflector Update Processing
======================
RR processes update differently depending on what type of peer they came from
-EBGP learned routes
.can be advertised to EBGP peers, clients, & Non clients
-client learned routes
.can be advertised to EBGP peers, clients, & non clients
-Non-cleient learned routes
.can be advertised to EBGP peers and clients
RR placement based upon these rules

Large Scale Route Reflection
=========================
Larger scale BGP designs cannot be serviced by only a single RR
-single RR is a single point of failure
RR “clusters” allow redundancy and hierarchy
-cluster is defined by the clients a RR servers
-RRs in the same cluster use the same cluster-ID

Inter-Cluster peerings between RRs can be client or non-client peerings
-depends on redundancy design

BGP Confederation
+=================
Reduces full mesh IBGP requirement by splitting AS into smaller Sub-Ases
-inside Sub-AS full mesh or RR requirement remains
-between sub-AS acts like EBGP
Devices outside the confederation do not know about the internal structure
-Sub-AS numbers are stripped from advertisements to “true” EBGP peers
Typically uses ASNs in private range (64512-65635)

BGP Confederation Configuration
=====================
Enable the BGP process
-router bgp [sub-as]
Specify the main AS number
-bgp confederation-id [main-as]
Specify other Sub-Ases that you peer with
-bgp confederation-peers [sub-as1 sub-asn]
-Not all sub-Ases, just those directly peered with

BGP NLRI Advertisement
====================
BGP NLRI can be originated by
-network statement
.requires exact match in the routing table first
-redistribute statement
.won’t include OSPF External by default
-aggregate-address statement
.requires one subnet in BGP table first
-bgp inject-map statement
.opposite of aggregation

BGP Network Statement
=====================
Originates prefixes with ORIGIN of iGP(i)
Requires exact match in the routing table
-Does not have to be a connected prefix, can be learned via IGP
Without mask keyword  assumes classful mask

BGP redistribute statement
=======================
Originates prefixes with ORIGIN of INCOMPLETE (?)
Originates classfull summary if auto-summary is enabled
Automatically copies IGP metric to BGP MED
Won’t include OSPF external by default
-redistribute ospf [pid] match internal external

BGP Aggregation
=================
Can be applied at any point in the network as long as one subnet is in the bGP table
Configured as aggregate-address [network] [mask] [args]
Arguments are ..
-summary-only
-suppress-map
-attribute-map | route-map
-as-set
-advertise-map

BGP conditional Route Injection
======================
Originates subnest(s) from aggregate for purpose of longest match traffic engineering
Configured as bgp inject-map inject-map exist-map exist-map [copy-attributes]
-Inject Map
.subnet to be advertised
.set ip address prefix-list [list]
-Exist Map
.Aggreate to be originated from
.match ip address prefix-list [list]
.match ip route-source prefix-list [list]

BGP Best Path Selection
===================
Chooses which routes can be
-installed in the RIB/FIB
-Advertised to the other BGP peers

Best path selection prerequisites
============================
Nexthop value must be in the routing table
-prevents route-recursion failure
Synchronization rule must be met or disabled
-Legacy black-hole prevention technique
AS-Path must not contain local-AS
-Normal EBGP loop prevention
First ASN in path must be neighbor’s ASN
-bgp enforce-first-as command

Best path Selection Order
====================
Weight
Local Preference
Locally Originated
AS-Path
Origin
MED
EBGP over IBGP (This is different form the AD)
IGP metric to Next-hop
Tie breakers
-Oldest
-Lowest RID
-Shortest cluster list
-Lowest neighbor address

Manipulating Best path selection
==========================
Outbound routing policy affects inbound traffic
Inbound routing policy affects outbound traffic
Weight and local pref
-set inbound
-affects outbound traffic
AS-path and MED
-set outbound
-affects inbound traffic

Best Path Selection Exception
=========================
AS-Path
-bgp bestpath as-path ignore
MED
-bgp always-compare-med
-bgp bestpath med-confed
.compare med for routes locally originated in the confederation
-bgp bestpath med missing-as-worst
.assign MED of 4,294,967,294 to NULL MED
-bgp deterministic med
.compare MED against all possible paths

BGP Communities
================
BGP’s implementation of a route-tag
Used to group prefixes together for
-advertisement policy
-filtering policy
-best path selection policy
Community is an optional transitive attribute
-not exchanged between peers by default
-neighbor [address] send-community

BGP Community Values
==============
Standard community is 4-byte value
Can be denoted as ..
-decimal (0-42944967296)
-AA:NN(00: - 65635:65535)
.ip bgpcommunity new-format
-same binary value regardless of visual format
Three “well-known” values are reserved

BGP well-known communities
=======================
No-export (0xFFFFFF01)
-don’t advertise to EBGP peers
No-advertise (0xFFFFFF02)
-don’t advertise to any peers
Local-AS (0xFFFFFF03)
-don’t advertise to confederation EBGP peers
-RFC defines as NO_EXPORT_SUBCONFED

Matching and setting Communities
==========================
Set occurs in route-map
-set community {community-number [additive] [well-known-community] | none}
-not additive by default

Match occurs by community-list
-Define list
.standard list matches community name or number
-ip community-list 1 standard permit no-export
.expanded matches regular expression
-ip community-list expanded AS100 permit 100:[0-9]+
-Reference from route-map
.match community AS100

Regular Expressions
=================
Used for string matching in..
-show command outputs
-TCL/EEM scripting
-BGP AS-path access lists
-BGP Expanded community lists

BGP Filtering
=================
BGP updates filtering occurs on a per peer bassis with..
-neighbor [address] distribute-list
-neighbor [address] filter-list
-neighbor [address] prefix-list
-neighbor [address] route-map

Using route-map avoids order of operations issues.

BGP Convergence
================
Hello and keepalive timers
-lowest timers are negotiated during peering establishment
-timers bgp
-neighbor timers

Link down detection
-bgp fast-external-fallover

Update timers
.neighbor advertisement-interval
-bgp nexthop {trigger {delay seconds | enable} | route-map map-name}
-bgp scan-time
-bgp update-delay

BGP Default routing
==================
Three ways to originate default
-default-information originate + redistribute
-network 0.0.0.0 mask 0.0.0.0
-neighbor default-originate

.supports conditional advertisement

Miscellaneous :
Attributes
well known mandatory: everyone supports, must be in update message (next_hop, origin, as_path)
well known discretionary: everyone supports, might not be in update message (local pref, atomic aggregate)
Optional transitive: travel from router to router or from AS to AS
Optional non-transitive:  does not travel from router to router (Aggregator, MED)

Most  preferred: Ignore
In bgp table : * means valid  and > means best route

Two ways to get networks into BGP
-network commands
-redistribution

BGP synchronization:
Do not use or advertise a route learned via IBGP until the same route has been learned from the internal routing protocol.

BGP next-hop processing:
-for IBGP peers: do not change next hop address on advertised routes.
-for EBGP peers: change next hop address on advertised routes.

When we create neighbor relation within IBGP or Ebgp between loopback addresses we need to use update source loopback
when we create neighbor relation between ebgp routers having loopback address we need to use ebgp multihop since loopback address sees itself sees as one hop away.

When only BGP is configured on IBGP, do no synchronization on all routers in AS and do clear and reset the process(clear ip bgp *)

Issue: since with IBGP, next hop is not changed, internal router will not be able to reach ebgp router so solution is to redistribute external ebgp route to routers in internal AS or another solution is to set next hop- self  command  in border router.

Weight is cisco propriety and its local to the router. It is set on per neighbor basis.

To disable the neighbor
neighbor 10.1.1.2 shut

origin code: i iGP(entering with network command) or e EGP or? incomplete (redistribute routes into BGP)

local pref : advertised within AS
bgp default local-preference 100. Mainly used when we want to pass routes through that particular router.

policy_routing : the programming language of routing table.