BGP Interview Question and Answers Prepared by VKT
BGP Interview Question and Answers Prepared by VKT
Answer: BGP stands for Border Gateway Protocol. It’s a set of rules (protocol) that helps networks talk to
each other and share information about how to reach different destinations on the internet. Think of it like a
GPS for the internet, guiding data to the right place.
Easy Explanation: Imagine BGP as a postman who knows the best route to deliver mail between different
cities (networks). It’s used to connect big networks, like those of internet providers.
Memory Tip: BGP = Best Gateway Picker – it picks the best path for data to travel across networks.
Answer: Yes, BGP is a dynamic routing protocol. This means it automatically updates and shares routing
information between networks without someone manually setting every route.
Easy Explanation: Think of BGP like a smart traffic app that updates road directions as traffic changes,
instead of using a fixed paper map.
Memory Tip: Dynamic = Auto-Updating – BGP keeps routes fresh without manual work.
Answer: BGP is an Exterior Gateway Protocol (EGP). It’s used to share routing information between
different networks (called Autonomous Systems), like between two internet providers.
Easy Explanation: BGP is like a diplomat who negotiates routes between different countries (networks), not
within a single country.
Memory Tip: EGP = External Gateway Protocol – BGP works outside one network.
Answer: BGP is called the Protocol of the Internet because it’s the main protocol that helps the entire
internet share routing information, connecting all the big networks worldwide.
Easy Explanation: BGP is like the internet’s phonebook, helping every network find every other network.
Memory Tip: Internet = BGP’s Playground – BGP connects the whole internet.
5. What layer does BGP work on, and what port does it use?
Answer: BGP works on the application layer (Layer 4) and uses TCP port 179 to communicate.
Easy Explanation: BGP sits on top of TCP, like an app on your phone that uses the internet to talk to other
devices. Port 179 is like its special phone number.
Memory Tip: 179 = BGP’s Phone Number – BGP uses TCP port 179 to chat.
Answer: BGP is a Path-Vector Routing Protocol, which means it keeps a list of all the networks (called
Autonomous Systems or AS) that data must pass through to reach its destination.
Easy Explanation: Imagine BGP keeping a list of cities your package travels through to reach you, so it knows
the exact path.
Memory Tip: Path-Vector = Path List – BGP tracks the path of networks to the destination.
Answer: An Autonomous System (AS) is a group of networks under one organization, like an internet
provider. BGP uses AS numbers to identify and connect these networks.
Easy Explanation: Think of an AS as a big company with its own set of computers. BGP helps these
companies talk to each other.
8. What are the two types of BGP, and how are they different?
Answer: BGP has two types: eBGP (External BGP) and iBGP (Internal BGP).
• eBGP: Used between different AS (like between two internet providers). The routers must be
directly connected.
• iBGP: Used within the same AS (inside one organization). Routers don’t need to be directly
connected.
Easy Explanation: eBGP is like two different companies shaking hands directly. iBGP is like coworkers in the
same company passing messages, even if they’re far apart.
Memory Tip: eBGP = External, iBGP = Internal – e for outside, i for inside.
Answer: BGP prevents loops by using AS numbers. It keeps track of the AS path. If a router sees its own AS
number in the path, it drops the route to avoid a loop.
Easy Explanation: Imagine BGP checking a package’s travel history. If it sees it’s already been to the same city
(AS), it stops to avoid going in circles.
Memory Tip: AS Path = No Loops – BGP uses AS numbers to stop data from circling back.
10. What are BGP peers, and how are they set up?
Answer: BGP peers are routers that share BGP information, also called BGP speakers. They don’t
automatically find each other; you must manually set them up to talk.
Easy Explanation: BGP peers are like friends who agree to share directions, but you have to introduce them
first—they don’t meet automatically.
Memory Tip: Peers = Planned Pals – BGP neighbors need manual setup.
• 200 for Internal BGP (iBGP) updates (within the same AS).
Lower numbers are preferred, so eBGP is trusted more than iBGP.
Easy Explanation: Administrative Distance is like a trust score. eBGP (20) is more trusted than iBGP (200), so
routers prefer eBGP routes.
Memory Tip: 20 = External, 200 = Internal – Lower number wins for eBGP.
Answer: No, BGP does not use load balancing. It picks one best path per network and uses only that path.
Easy Explanation: BGP is picky—it chooses one road for data to travel, not multiple roads at once.
Memory Tip: One Path = BGP’s Rule – BGP sticks to a single best route.
Answer: BGP is classless and supports FLSM (Fixed-Length Subnet Mask), VLSM (Variable-Length Subnet
Mask), and CIDR (Classless Inter-Domain Routing).
Easy Explanation: BGP can handle any type of IP address splitting, whether fixed or flexible, making it
versatile for big networks.
Memory Tip: Classless = Flexible – BGP works with all IP address styles.
Answer: BGP sends updates as unicast (one-to-one) to manually defined neighbors. Updates are
incremental (only changes are sent) and triggered (sent when something changes).
Easy Explanation: BGP sends updates like targeted text messages to specific friends, only when there’s new
information.
Memory Tip: Unicast Updates = Targeted Texts – BGP sends changes to specific peers.
Answer: BGP is used for scalability because it can handle huge numbers of routes (like the whole internet).
It’s reliable because it carefully chooses paths and avoids loops.
Easy Explanation: BGP is like a super-organized librarian who can manage millions of books (routes) and
always finds the right one without mistakes.
Memory Tip: Scalability = Big, Reliability = Safe – BGP handles big networks safely.
Below is a visual representation of key BGP concepts using color-coded text to make it easy to understand
and remember. Colors are chosen to be clear in both dark and light themes.
BGP BASICS
BGP = Border Gateway Protocol: Connects big networks (like internet providers).
Uses TCP Port 179: BGP talks over TCP, like an app on the internet.
Peers = BGP Speakers: Routers that share routes, manually set up.
Color-Coded Explanation:
Answer:
Each AS needs a unique AS Number (ASN) so that the internet knows which AS is which, just like every house
needs a unique address. This helps BGP prevent loops (when data keeps circling back) and ensures data goes
to the right place.
• Plaintext to Memorize:
ASN = Unique ID for AS to avoid confusion and loops.
• Memory Tip:
Think of ASNs as phone numbers. If two people had the same number, calls would get mixed up. ASNs
keep internet traffic clear.
• Easy Explanation:
When ASes talk using BGP, they use their ASNs to say, “Hey, I’m AS 123!” This stops data from getting
stuck in a loop and helps routers know where to send information.
Question 3: What’s the difference between routing inside and outside an AS?
Answer (Simple Explanation):
Inside an AS, networks talk to each other using Internal Gateway Protocols (IGPs), like OSPF or RIP. It’s like
people chatting within the same city. Between different ASes, we use BGP (Border Gateway Protocol) to share
information. It’s like cities sending messages to each other through a special courier.
Color-Coded Explanation:
Color-Coded Explanation:
• Loop Prevention: Stops data from circling back to the same AS.
Answer:
A 2-byte AS number is a smaller number (like a short name) that can only give us 65,536 possible ASNs (from
0 to 65535). Because we ran out of these, we now use 4-byte AS numbers, which give us 4.3 billion ASNs (from
65536 to 4294967295). The 4-byte numbers are like longer names to support more networks.
• Plaintext to Memorize:
2-byte ASN = 65,536 numbers (0–65535).
4-byte ASN = 4.3 billion numbers (65536–4294967295).
• Memory Tip:
Think of 2-byte as a small phone book (limited names) and 4-byte as a huge phone book (tons of
names) because the internet grew too big.
• Easy Explanation:
The internet used to have enough 2-byte ASNs, but as more companies joined, we needed more
numbers. So, 4-byte ASNs were created to give us billions of options. Some numbers in both are saved
for private use (like private phone lines).
Question 6: What are public and private AS numbers, and what are their ranges?
Answer:
Public AS numbers are used by organizations on the global internet, like a public address everyone can see.
Private AS numbers are used inside private networks, like a company’s internal ID that’s not shared publicly.
• 2-byte AS ranges:
• 4-byte AS ranges:
• Plaintext to Memorize:
2-byte: Public 1–64495, Private 64512–65534, Reserved 0 & 65535.
4-byte: Public 65536–4199999999, Private 4200000000–4294967294.
• Memory Tip:
Picture public ASNs as “store signs” visible to everyone, and private ASNs as “office room numbers”
only used inside. The 2-byte range is like a small town’s addresses, and 4-byte is a big city’s
addresses.
• Easy Explanation:
Public ASNs are for companies that connect to the global internet, like ISPs. Private ASNs are for
companies that keep their networks private, like a business’s internal system. Some numbers are
reserved so they don’t get mixed up.
Answer:
If one router uses 4-byte ASNs and another only supports 2-byte ASNs, they can still work together using a
special number called ASN 23456. This number acts like a “translator” to make sure both routers understand
each other.
• Plaintext to Memorize:
ASN 23456 = Translator for 4-byte and 2-byte ASNs.
• Memory Tip:
Think of ASN 23456 as a “universal adapter” for plugging old and new devices together.
• Easy Explanation:
Some older routers only understand 2-byte ASNs, but newer ones use 4-byte ASNs. To avoid
problems, BGP uses ASN 23456 to help them talk without errors, like a middleman making sure both
sides get the message.
Question 8: What are the three ways to write 4-byte AS numbers, and how do they work?
Answer:
There are three ways to write 4-byte AS numbers: Asplain, Asdot+, and Asdot. They’re just different formats to
show the same number, like writing a phone number with or without dashes.
1. Asplain:
2. Asdot+:
o Splits the number into two parts (like high and low) with a dot.
o Example: 65536 becomes 1.0, 65537 becomes 1.1, 4294967296 becomes 65535.65535.
3. Asdot:
o Numbers below 65536 are written as Asplain (e.g., 65535 stays 65535).
• Memory Tip:
• Easy Explanation:
These are just different styles to write big AS numbers. Asplain is straightforward, like writing “1000.”
Asdot+ breaks it into chunks, like “1.0,” to make big numbers easier. Asdot uses Asplain for smaller
numbers and Asdot+ for bigger ones, like a smart mix.
Question 10: How do you convert an AS number to Asdot format? (Example: 194534)
1. Divide the number by 65,535. Take the whole number result (e.g., 194534 ÷ 65,535 = 2). This is the
part before the dot.
2. Multiply 65,535 by that number (2 × 65,535 = 131,070). Subtract it from the original number
(194534 – 131,070 = 63,464).
4. Write it as 2.63462.
Color-Coded Explanation:
Answer:
BGP stands for Border Gateway Protocol. It’s a protocol used to exchange routing information between
routers, like a GPS for the internet. It has two types:
• iBGP (Internal BGP): Used when routers are in the same network group (same Autonomous
System or AS).
• eBGP (External BGP): Used when routers are in different network groups (different AS).
Memory Tip: Think of iBGP as "inside the same family" (same AS), and eBGP as "external, between different
families" (different AS). Picture iBGP as friends chatting within a house, and eBGP as neighbors talking across
a fence.
Explanation:
• BGP helps routers decide the best path to send data across networks, like choosing the fastest road to
a destination.
• iBGP is for routers inside the same organization (same AS), like employees in the same company
sharing info.
• eBGP is for routers in different organizations, like two companies exchanging data or an organization
talking to an Internet Service Provider (ISP).
Visual Picture:
Imagine a blue house (iBGP) where everyone inside shares info freely (same AS). Outside, there’s an orange
fence (eBGP) where the house talks to a neighbor’s house (different AS).
Answer:
iBGP (Internal Border Gateway Protocol) is when two routers in the same AS (Autonomous System, like a
network group) share routing info. It’s used inside an organization to keep all routers on the same page about
routes.
Memory Tip: Think of i in iBGP as "inside." Picture a team meeting in one office where everyone shares the
same company rules (same AS).
Explanation:
• iBGP runs between routers in the same network group (AS). For example, in a big company, all
routers in its network use iBGP to share routing info.
• It helps routers inside the organization know how to send data to each other or to outside networks.
• Example: If a company has routers in New York and Chicago in the same AS, they use iBGP to talk.
Visual Picture:
Picture a blue circle (one AS) with routers inside it, like friends in a group chat sharing directions (routes)
within the same company.
Answer:
eBGP (External Border Gateway Protocol) is when two routers in different AS (different network groups)
share routing info. It’s used between organizations or between an organization and an ISP.
Memory Tip: Think of e in eBGP as "external." Imagine two different companies shaking hands across a
border to share info.
Explanation:
• eBGP connects routers in different AS, like two separate companies or a company and its ISP.
• It’s how the internet connects different networks, like linking your company’s network to Google’s or
your ISP’s network.
Visual Picture:
Imagine two houses (two AS) with an orange line connecting them. Routers at the edge of each house talk to
share directions across the boundary.
Question 4: What’s the difference between iBGP and eBGP in terms of where they run?
Answer:
Memory Tip: iBGP = "inside same AS," eBGP = "external, different AS." Think of iBGP as a family dinner
(same group) and eBGP as a meeting with outsiders (different groups).
Explanation:
• iBGP is for routers inside one organization’s network, like all routers in a university’s network
sharing info.
• eBGP is for routers connecting different networks, like a university’s router talking to an ISP’s router.
Visual Picture:
Picture a blue bubble (iBGP) for routers in one AS, and an orange bridge (eBGP) connecting two different
bubbles (different AS).
Answer:
• iBGP: Routers don’t need to be directly connected. They can be far apart in the same AS.
Memory Tip: For iBGP, think "inside, no need to be close." For eBGP, think "external, must be next-door
neighbors." Picture iBGP routers texting across a city, but eBGP routers need to be side by side.
Explanation:
• iBGP routers can be anywhere in the same AS, like two routers in different cities of the same
company. They use other protocols to reach each other.
• eBGP routers are usually directly linked, like a cable between two routers in different organizations,
because they’re set with a TTL (Time To Live) of 1, meaning the signal can’t hop far.
Visual Picture:
For iBGP, imagine routers in a blue cloud talking over long distances. For eBGP, picture two routers
connected by a short orange cable between two networks.
Answer:
• eBGP: TTL = 1 (only goes one hop, so neighbors must be directly connected).
Memory Tip: iBGP = "big TTL (255)," can go far. eBGP = "tiny TTL (1)," stays close. Picture iBGP as a long-
distance call (255) and eBGP as a short whisper (1).
Explanation:
• TTL (Time To Live) is like a timer for how far a packet can travel.
• iBGP has a high TTL (255), so routers can be far apart in the same AS.
• eBGP has a low TTL (1), so routers must be directly connected, like next-door neighbors.
Visual Picture:
For iBGP, imagine a blue airplane flying far (TTL 255). For eBGP, picture a short orange handshake
between two routers (TTL 1).
Question 7: What is the Administrative Distance for iBGP and eBGP routes?
Answer:
Memory Tip: iBGP = "high number (200)," less trusted. eBGP = "low number (20)," more trusted. Think of
eBGP as a VIP (low number, high priority) and iBGP as a regular guest (high number, lower priority).
Explanation:
• Administrative Distance (AD) is a number that shows how much a router trusts a route. Lower
numbers are more trusted.
• eBGP routes (AD = 20) are trusted more because they come from outside the network (different AS).
• iBGP routes (AD = 200) are less trusted because they’re internal and might compete with other
internal protocols.
Visual Picture:
Imagine eBGP as a bright orange star (AD 20, high trust) and iBGP as a dim blue star (AD 200, lower trust)
in a router’s sky.
Question 8: What happens to the next hop when routes are advertised in iBGP and eBGP?
Answer:
• iBGP: The next hop stays the same when a route is shared with another iBGP router.
• eBGP: The next hop changes to the local router when a route is shared with an eBGP router.
Memory Tip: iBGP = "keep next hop." eBGP = "change next hop." Picture iBGP as passing a note without
changing the address, and eBGP as rewriting the address to your own.
Explanation:
• In iBGP, the next hop (the next router to send data to) doesn’t change because all routers are in the
same AS and know the original next hop.
• In eBGP, the next hop changes to the local router’s address because the receiving router is in a
different AS and needs a new address to follow.
Visual Picture:
For iBGP, imagine a blue envelope passed with the same address. For eBGP, picture an orange envelope
with the address rewritten to the sender’s address.
Answer:
No, iBGP routes learned from an iBGP peer cannot be shared with another iBGP peer. But they can be
shared with an eBGP peer.
Memory Tip: Think of iBGP as a "no gossip rule" within the same AS—routers don’t pass iBGP routes to other
iBGP routers. But they can tell eBGP routers outside the AS.
Explanation:
• iBGP has a rule to prevent loops: routes learned from one iBGP router can’t be sent to another iBGP
router in the same AS.
• However, those routes can be sent to eBGP routers in a different AS to share with other networks.
• This is why iBGP often uses a full mesh or route reflectors to share routes within the AS.
Visual Picture:
Imagine a blue room (iBGP) where people don’t gossip with each other but can shout to an orange room
(eBGP) outside.
Answer:
Yes, eBGP routes learned from an eBGP peer can be shared with both eBGP and iBGP peers.
Memory Tip: eBGP = "everyone can know." Picture eBGP as a news broadcast that can be shared with
everyone, inside or outside the AS.
Explanation:
• eBGP routes from a different AS can be advertised to both eBGP peers (in other AS) and iBGP peers
(in the same AS).
• This allows networks to share external routes freely, helping the internet stay connected.
Visual Picture:
Picture an orange megaphone (eBGP) broadcasting news to both a blue room (iBGP) and other orange
rooms (eBGP).
Question 11: What attributes are sent in iBGP and eBGP messages?
Answer:
Memory Tip: iBGP = "internal, shares preferences." eBGP = "external, no preferences." Think of iBGP as
friends sharing favorite routes, while eBGP is formal and skips preferences.
Explanation:
• iBGP shares attributes like local preference (a way to rank routes) because routers in the same AS
need to agree on the best paths.
• eBGP doesn’t share local preference because different AS have their own rules and don’t need to
share internal preferences.
Visual Picture:
Imagine iBGP as a blue notebook with a list of favorite routes shared inside a team. eBGP is an orange letter
with basic info, no favorites included.
Answer:
To configure iBGP, both routers must have the same AS number in their BGP configuration, and you specify
the neighbor’s IP and AS. Example:
We’ll use two routers (R1 and R2) in the same AS (AS 1000), connected via a single link. Each router will have
a loopback interface to simulate a network to advertise via iBGP.
Image Placeholder 1: Insert a diagram showing two routers (R1 and R2) connected via a single Ethernet link
(e.g., FastEthernet0/0 on both routers). Label R1 with IP 10.10.12.1/30 and R2 with 10.10.12.2/30 on the
link. Show loopback interfaces: R1 (150.1.1.1/32) and R2 (150.2.2.2/32). Include a text label indicating both
routers are in AS 1000.
Configure the physical and loopback interfaces on both routers to establish connectivity.
R1 Configuration
R2 Configuration
Explanation:
• The FastEthernet0/0 interfaces form the physical connection between R1 and R2 using a /30 subnet.
Verification:
Image Placeholder 3: Insert a screenshot of the emulator’s console showing the successful ping from R1 to
R2 (10.10.12.2).
Set up the BGP process on R1 and establish an iBGP neighbor relationship with R2.
Explanation:
• router bgp 1000: Starts the BGP process with AS number 1000.
• network 150.1.1.1 mask 255.255.255.255: Advertises R1’s loopback interface into BGP.
Configure R2 to form an iBGP session with R1 and advertise its loopback interface.
Explanation:
• Similar to R1, R2 is configured to run iBGP in AS 1000 and peers with R1.
Image Placeholder 4: Insert a screenshot of the emulator’s console showing the BGP configuration
commands entered on R1 and R2.
On R1:
Expected Output:
• Look for “State/PfxRcd” showing “1” (indicating one prefix received from R2) and “Up/Down”
showing a time (e.g., “00:05:00”), confirming the session is up.
On R2:
• Similar output should show R1 (10.10.12.1) as a neighbor with one prefix received.
Image Placeholder 5: Insert a screenshot of the show ip bgp summary output on R1, highlighting the
neighbor state and prefixes received.
Check the BGP routing table to ensure each router has learned the other’s loopback network.
On R1:
Expected Output:
• The route to 150.2.2.2/32 is learned via iBGP (note the “i” for internal).
On R2:
Image Placeholder 6: Insert a screenshot of the show ip bgp output on R1, highlighting the learned route
(150.2.2.2/32).
Verify that R1 can ping R2’s loopback address and vice versa, using the BGP-learned routes.
On R1:
Expected Output:
On R2:
Explanation:
• The source keyword ensures the ping uses the loopback interface, testing the BGP-advertised routes.
• If the ping fails, check if the BGP session is up (show ip bgp summary) and ensure routes are in the
routing table (show ip route).
Image Placeholder 7: Insert a screenshot of the successful ping from R1 to R2’s loopback (150.2.2.2).
1. Check Connectivity: Ensure R1 and R2 can ping each other’s FastEthernet IPs.
• Look for “State: Established.” If stuck in “Active” or “Idle,” check for typos or connectivity
issues.
Save the configurations on both routers to ensure they persist after a reboot.
On R1 and R2:
Image Placeholder 9: Insert a screenshot of the “write memory” command output, confirming the
configuration is saved.
Answer:
• Objective: Configure eBGP between two routers in different AS to exchange routing information.
• Topology: Two routers (R1 and R2) connected via a single link. R1 is in AS 100, and R2 is in AS 200.
Each router has a loopback interface to simulate networks.
1. Launch Your Simulator: Open GNS3, Packet Tracer, or your preferred tool.
2. Add Two Routers: Place two Cisco routers (e.g., Cisco 7200 in GNS3 or equivalent in Packet Tracer).
3. Connect the Routers:
o Connect R1’s GigabitEthernet0/0 to R2’s GigabitEthernet0/0 using a serial or Ethernet link.
o If using a simulator, ensure the link is active (e.g., green link status in GNS3).
4. Power On Routers: Start both routers in the simulator.
On R1:
On R2:
Explanation:
• Hostnames help identify routers.
• The GigabitEthernet0/0 interfaces use a /30 subnet for the point-to-point link.
• Loopback0 interfaces simulate networks to advertise via BGP.
• no shutdown activates the interfaces.
On R1:
On R2:
Troubleshooting:
• If pings fail, check interface status (show ip interface brief) and ensure interfaces are “up/up.”
• Verify IP addresses and subnet masks.
On R1:
On R2:
Explanation:
• router bgp <AS> starts the BGP process with the specified AS number.
• neighbor <IP> remote-as <AS> defines the neighbor and its AS number.
• network <IP> mask <mask> advertises the loopback network into BGP. The exact mask is required
for loopback interfaces (/32).
On R1:
On R2:
Explanation:
• The State/PfxRcd column shows “1,” indicating one prefix received from the neighbor.
• If the state is “Active” or blank, the session isn’t established. Check AS numbers, neighbor IPs, or
connectivity.
Step 6: Verify BGP Routes
Confirm that each router has learned the other’s loopback network via BGP.
On R1:
On R2:
Explanation:
Ping R2’s loopback (2.2.2.2) from R1 and vice versa to confirm BGP routes work.
On R1:
On R2:
Explanation:
• The source option ensures the ping uses the loopback IP, verifying BGP-advertised routes.
• If pings fail, check the routing table (show ip route) and BGP table (show ip bgp).
•
Step 8: Save Configurations
On R1 and R2:
Troubleshooting Tips
• BGP Not Forming:
o Verify neighbor IP and AS numbers match on both sides.
o Ensure interfaces are up (show ip interface brief).
o Check for firewalls or ACLs blocking TCP port 179 (BGP).
• Routes Not Advertised:
o Confirm the network command matches the exact subnet/mask in the routing table.
o Use show ip route to verify the network exists locally.
• Ping Fails:
o Check the routing table (show ip route) to ensure BGP routes are installed.
o Verify next-hop reachability.
Optional Enhancements
• Advertise More Networks: Add more loopback interfaces and advertise them via BGP.
• Use Loopback for BGP: Configure BGP to use loopback IPs as neighbors (requires neighbor <IP>
update-source Loopback0 and a static route or IGP).
• Add Authentication: Use neighbor <IP> password <password> for security.
Key Notes
• iBGP vs. eBGP: iBGP runs within the same AS (AS 1000 in this lab), while eBGP runs between
different ASes. This lab focuses on iBGP.
• Loopback Interfaces: Using loopbacks for iBGP peering is common in real networks for stability. For
simplicity, this lab uses physical interface IPs.
• Full Mesh Requirement: In iBGP, all routers in the same AS must be fully meshed (each router peers
with every other router) unless using route reflectors. This lab uses a simple two-router setup, so a
full mesh is achieved.
• Scalability: For larger networks, consider using route reflectors to reduce the number of iBGP
sessions (as mentioned in).
Plaintext Summary for Memorization
• eBGP = different AS, outside, TTL 1, AD 20, direct connection, next hop changes, shares with all, no
local preference.
➢ IBGP
➢ EBGP
➢ BGP TABLES.
Question 1: What are the three tables used by BGP, and what do they do?
Answer:
BGP (Border Gateway Protocol) uses three tables to manage routing information:
BGP (Border Gateway Protocol) uses three main tables to manage routing information:
1. Neighbor Table ( Green): This table lists all the routers that BGP is connected to (called
neighbors). It shows details like their IP addresses and connection status.
2. Forwarding Table ( Purple): This table lists all the networks BGP knows about, along with their
paths and attributes (like which path is best).
3. Routing Table ( Blue): This table shows the best path to each network and the next hop (where to
send traffic).
Plaintext to Memorize:
"Neighbor lists friends, Forwarding knows paths, Routing picks the best."
Memory Tip:
Think of BGP as a travel planner:
• Routing Table is the final itinerary with the best roads to take.
Easy Explanation:
Imagine you’re planning a trip. The Neighbor Table is like your phone’s contact list of friends (routers) you
can ask for directions. The Forwarding Table is like a big map showing all possible routes to a city. The
Routing Table is your GPS picking the fastest route to your destination.
Question 2: What does the show ip bgp summary command show, and what is an example from the
document?
Answer:
The show ip bgp summary command displays the Neighbor Table ( Green). It shows:
• The BGP router ID (like a name for your router, e.g., 1.11.11.11).
Plaintext to Memorize:
"Show ip bgp summary = Neighbor Table, shows router ID and AS number."
Memory Tip:
Think of “summary” as a quick summary of your router’s buddies (neighbors). Picture a green phone ( )
showing your contacts list to remember it’s the Neighbor Table.
Easy Explanation:
This command is like checking your phone’s contact list to see who’s online and ready to talk. It tells you
about your router’s friends (neighbors) and how much space their info takes up in memory.
• BGP router identifier: The IP address identifying this BGP router (e.g., 192.168.1.1).
• Local AS number: The Autonomous System number of this router (e.g., 65001).
• BGP table version: Tracks changes to the BGP routing table (higher number = more updates).
• Memory usage: Bytes used by BGP for prefixes, paths, and attributes.
• Neighbor: IP address of the BGP neighbor.
• State/PfxRcd: Session state (e.g., Established) or number of prefixes received from the neighbor.
Question 3: What information does the Forwarding Table provide, and what command shows it?
Answer:
The show ip bgp command shows the Forwarding Table ( Purple). It includes:
• Next Hop (e.g., 192.168.12.2, the next router to send traffic to).
• Metric, LocPrf, Weight: These are numbers BGP uses to pick the best path.
• Path: The list of AS (Autonomous Systems) the route passes through (e.g., 32.68).
• Status Codes:
o * (valid route).
• Origin Codes:
o ? (redistributed network).
Plaintext to Memorize:
"Forwarding Table = show ip bgp, shows networks, next hop, and best path."
Memory Tip:
Picture a purple map ( ) with all the roads and a big star ( ) marking the best one. The star reminds you
of the > symbol for the best path.
Easy Explanation:
This command is like opening a map app that shows all possible roads to a destination. It tells you the roads
(networks), where to turn next (next hop), and which road is the fastest (best path).
❖ FIELD IN SH IP BGP
• Next Hop: The IP address of the next router to reach the destination.
• LocPrf: Local preference, used to prefer certain paths within the same AS (higher is better).
• Weight: A Cisco-specific value to prefer routes (higher is better, local to the router).
• Path: The AS (Autonomous System) path, showing the sequence of AS numbers the route traverses.
• Status Codes:
• Origin Codes:
o e (EGP),
Key Points
• The > symbol marks the best path used for routing.
• This command helps diagnose issues like missing routes or incorrect AS paths.
Answer:
The status codes ( Brown) in the show ip bgp command tell you about the routes:
• > (greater than): This is the best path chosen by BGP to reach the network.
• Other codes:
Plaintext to Memorize:
"> = Best path in Forwarding Table."
Memory Tip:
Picture a brown checklist ( ) with a checkmark (*) for valid routes and a gold star (>) for the best one.
Imagine smaller notes for other codes like i or s.
Easy Explanation:
Think of * as a checkmark ( ) saying, “This route works!” The > is like a gold star ( ) saying, “This is the
best route!” Other codes are like notes explaining why a route isn’t used.
Question 5: What is the Routing Table, and what command displays it?
Answer:
The Routing Table lists the best paths to reach destination networks, including the next hop IP address
where traffic should be sent. It only includes the routes BGP has chosen as the best. The command to view it is
show ip route bgp.
The show ip route bgp command shows the Routing Table ( Blue). It lists:
• The time since the route was learned (e.g., 01:36:07, meaning 1 hour, 36 minutes, 7 seconds).
Memory Tip:
Think of a blue GPS screen ( ) showing only the best route. Imagine a clock ( ) on the screen to remind
you of the time since the route was learned.
Easy Explanation:
This command is like your GPS giving you the final driving directions. It picks the best road (path) and tells
you exactly where to turn next (next hop) to reach your destination.
Simple Description
• Command Purpose: Displays only the BGP-learned routes in the router’s routing table.
• Output Breakdown:
o [20/0]: The first number (20) is the BGP administrative distance (external BGP default is
20). The second number (0) is the metric, though BGP often uses attributes like AS path
instead.
o 00:15:32: How long the route has been in the table (uptime).
• Use Case: Helps network administrators verify which routes are being learned from BGP neighbors,
check next-hop addresses, and troubleshoot routing issues.
• Key Notes:
o Only BGP routes are shown, not routes from other protocols like OSPF or static routes.
o The output may vary slightly depending on the router vendor or software version.
Question 6: What does the Next Hop field mean in BGP tables?
Answer:
The Next Hop ( Yellow) in BGP tables tells the router where to send traffic for a specific network.
• In the Forwarding Table: A next hop of 0.0.0.0 means the network is local (originated on this
router). Otherwise, An IP like 192.168.12.2 means the router learned the network from that IP.
• It shows the IP address (e.g., 192.168.12.2) of the next router to forward traffic to.
Plaintext to Memorize:
"Next Hop = Where to send traffic next; 0.0.0.0 means it’s local."
Memory Tip:
Picture a yellow road sign ( ) pointing to the next town (router). If it says “0.0.0.0,” it’s like saying, “You’re
already at the starting point!”
Easy Explanation:
Next Hop is like the address of the next person you pass a package to, so they can deliver it to the final
destination. If it’s 0.0.0.0, you’re the one holding the package.
Question 7: What is the Administrative Distance in the Routing Table, and what’s an example from the
document?
Answer:
The Administrative Distance (AD) ( Red) is a number that shows how trustworthy a route is in the
Routing Table (show ip route bgp). It helps the router decide which route to use when multiple protocols
(like BGP, OSPF, or RIP) provide paths to the same network.
• For eBGP (external BGP, between different Autonomous Systems), the AD is 20, meaning it’s very
trustworthy.
• For iBGP (internal BGP, within the same Autonomous System), the AD is 200, making it less preferred
than eBGP.
• A lower AD means the route is preferred over routes from other protocols. For example:
Plaintext to Memorize:
"AD = Trust level; eBGP AD is 20."
Memory Tip:
Picture a red trust badge ( ) with the number 20 for eBGP, shining brightly to show it’s the most trusted.
Imagine higher numbers (like 110 for OSPF) as less shiny badges, so eBGP always wins.
Easy Explanation:
Think of Administrative Distance as a trust score for routes. A lower score (like 20 for eBGP) means the router
trusts that route more and will choose it over routes with higher scores (like OSPF’s 110 or RIP’s 120). It’s like
picking the most reliable friend to guide you on a trip.
Below is a color-coded summary of the key points to make it visually easy to remember. Colors are chosen to
be clear in both light and dark themes.
text
Copy
**Neighbor Table**: Lists BGP friends (routers). Command: *show ip bgp summary*
**Forwarding Table**: Shows all networks and paths. Command: *show ip bgp*
**Routing Table**: Lists best paths and next hop. Command: *show ip route bgp*
Color Key:
• Red: Next Hop (think “red for redirecting traffic”). show ip bgp Command
➢ BGP ACTIVE AND PASSIVE.
Answer:
In BGP, Active means the router is the client and tries to start the connection using a random port (above
1023). Passive means the router is the server and waits for the connection on TCP port 179.
Easy Explanation:
Think of BGP like a phone call. The Active router is like someone who picks up the phone and dials (using a
random port). The Passive router is like someone waiting for the phone to ring (on port 179). Only one router
needs to start the call for BGP to work.
Memory Tip:
Imagine Active = Always Calling (like a client making a call) and Passive = Patiently Waiting (like a server
answering). Blue is for calm, like the Passive server waiting.
Answer:
By default, the router with the lowest BGP Router ID (RID) starts the connection and becomes Active. The
other router becomes Passive and waits.
Easy Explanation:
BGP routers have an ID, like a name tag. The router with the "smaller name" (lowest RID) takes charge and
starts the connection, while the other waits. It’s like two friends deciding who calls first—the one with the
shorter name does!
Memory Tip:
Think of Green = Go, like the router with the lowest ID "goes first" to start the connection. Picture a green
light for the Active router.
Interview Question 3: What ports do Active and Passive routers use in BGP?
Answer:
The Active router uses a random port (higher than 1023, like 25117 or 65479). The Passive router always
uses TCP port 179.
Easy Explanation:
Ports are like doors for communication. The Passive router always uses the same door (port 179), like a
house with one entrance. The Active router picks any random door (above 1023) to knock on the Passive
router’s door.
Memory Tip:
Red = Remember 179 for the Passive router’s port. Imagine a red door labeled "179" for the Passive router,
and a random red number for the Active router’s port.
Interview Question 4: How can you check if a router is Active or Passive in BGP?
Answer:
Use the command show ip bgp neighbors | in host on the router. It shows:
Easy Explanation:
This command is like checking a router’s call log. If the router’s port is 179, it’s waiting (Passive). If it’s a
random number, it’s calling (Active). For example, if R1’s local port is 179 and R2’s is 25117, R1 is Passive, and
R2 is Active.
Memory Tip:
Purple = Probe with Commands. Picture a purple magnifying glass inspecting the router’s status.
Remember "179 = Passive" and "random = Active."
Interview Question 5: What happens when you use the clear ip bgp * command?
Answer:
The clear ip bgp * command resets all BGP connections. After this, the router with the lowest BGP Router ID
becomes Active again, and the other becomes Passive.
Easy Explanation:
This command is like restarting a phone call. It hangs up all BGP connections, and the routers decide again
who calls (Active) based on the lowest Router ID. For example, after clearing, R1 might become Active
(random port) and R2 Passive (port 179).
Memory Tip:
Orange = Off and On. Imagine an orange reset button that restarts BGP, making the lowest ID router Active
again.
Interview Question 6: How can you manually set a router to be Active or Passive in BGP?
Answer:
To make a router Passive, use:
neighbor <IP> transport connection-mode passive
To make a router Active, use:
neighbor <IP> transport connection-mode active
For example, on R1:
R1(config-router)#neighbor 192.168.12.2 transport connection-mode passive makes R1 Passive. On R2:
R2(config-router)#neighbor 192.168.12.1 transport connection-mode active makes R2 Active.
Easy Explanation:
By default, BGP decides who’s Active or Passive based on Router ID. But you can force it with these commands,
like telling one router, “You wait for the call” (Passive) and the other, “You make the call” (Active).
Memory Tip:
Yellow = You Control. Picture a yellow switch you flip to decide if a router is Active or Passive. Yellow
reminds you of manually setting the mode.
Interview Question 7: Why might you want to manually set Active or Passive modes?
Answer:
Manually setting Active or Passive modes helps control which router starts the BGP connection. This is
useful for:
• Network design: Ensuring specific routers initiate connections for better management.
Easy Explanation:
It’s like deciding who calls in a group project. By setting one router as Passive, you ensure it waits for a trusted
router to connect, which can make your network safer or easier to manage.
Memory Tip:
Pink = Plan. Think of a pink planner where you decide which router calls or waits to keep things organized.
text
Copy
**Active = Client, calls with random port > 1023** | **Passive = Server, waits on port 179**
Question 1: What are BGP neighbor states, and why are they important?
Simple Explanation:
Think of BGP neighbor states like the steps you take to make a new friend. First, you say hi (connect), then you
introduce yourself (send messages), and finally, you start sharing stories (routes). If something goes wrong,
you might stop talking (go back to the start). These states help you know if the routers are ready to share
network information.
Memory Tip:
Imagine BGP as a friendship process. Each state is a step in making a strong connection, like meeting,
chatting, and trusting each other. Picture a ladder where each step is a state you climb to reach a full
friendship.
Color Used:
Blue – Represents the foundation of BGP, easy to remember as the starting point.
Question 2: What is the first BGP neighbor state, and what happens in it?
Simple Explanation:
Idle is like when you’re not ready to talk to someone yet. The router is quiet, maybe because it’s not
configured properly, or it’s waiting for the right moment to start a conversation. It’s the starting line before
any connection happens.
Memory Tip:
Think of Idle as a red stoplight . The router is stopped and not moving forward until it’s ready to connect.
Color Used:
Red – Like a stop sign, signaling the router is paused or not active.
Memory Tip:
Picture Connect as an orange phone ringing. Orange is bright and signals action, like trying to make a
connection.
Color Used:
Orange – Represents the action of trying to connect, like a bright, hopeful signal.
Simple Explanation:
Active is like redialing a friend after a dropped call. The router is persistent, trying to reconnect or waiting
for the other router to call. It’s not giving up yet but hasn’t succeeded.
Memory Tip:
Think of Active as a purple retry button . Purple stands for persistence, as the router keeps trying to make
the connection work.
Color Used:
Purple – Symbolizes effort and retrying, a unique color to stand out.
Simple Explanation:
OpenSent is like shaking hands after connecting. The router says, “Hi, I’m ready to be friends!” and waits for
the other router to say the same. It’s a step closer to sharing routes.
Memory Tip:
Picture OpenSent as a green handshake . Green means progress, like moving forward in the friendship.
Color Used:
Green – Represents progress and moving closer to a connection, like a green light.
Simple Explanation:
OpenConfirm is like checking if your friend is still on the call. Both routers have introduced themselves,
and now they send a quick “I’m here!” message to confirm they’re ready to share routes.
Memory Tip:
Think of OpenConfirm as a yellow checkmark . Yellow is bright and signals confirmation that things are
going well.
Color Used:
Yellow – Stands for confirmation, like a bright signal that both sides agree.
Simple Explanation:
Established is like being best friends. The routers trust each other and share network paths (routes). They
keep checking in with Keepalives to make sure the friendship stays strong.
Memory Tip:
Picture Established as a cyan trophy . Cyan is a cool, calm color that shows the connection is complete and
successful.
Color Used:
Cyan – Represents completion and a stable, working connection.
Simple Explanation:
Configuring BGP is like giving a router a phone number to call a specific friend. You have to set it up
manually because BGP doesn’t shout out to find neighbors—it’s picky and only talks to routers you specify.
Memory Tip:
Think of manual configuration as a pink address book . Pink is memorable, and it reminds you that you
need to write down the neighbor’s details yourself.
Color Used:
Pink – Stands for manual setup, a unique color for configuration tasks.
Simple Explanation:
Port 179 is like the specific phone number BGP uses to call its neighbor. It ensures the routers can talk
securely and reliably using TCP.
Memory Tip:
Picture port 179 as a magenta phone cord connecting two routers. Magenta is vibrant and helps you recall
this specific port.
Color Used:
Magenta – Represents the connection channel, bright and distinct.
Simple Explanation:
A reset is like hanging up the phone and starting over. If something goes wrong (like a bad connection or an
error message), the routers stop talking and go back to the beginning (Idle).
Memory Tip:
Think of a reset as a brown eraser wiping the slate clean. Brown is earthy and reminds you of starting
fresh.
Color Used:
Brown – Symbolizes resetting or starting over, like clearing the board.
1. Idle
Explanation: The router is not talking to its neighbor. It’s either off, just configured, waiting to retry, or reset
after a problem. This is the starting point where no connection exists.
2. Connect
Explanation: The router tries to start a connection using TCP on port 179. It’s waiting for the TCP three-
way handshake (SYN, SYN-ACK, ACK). If it works, it moves to OpenSent. If it fails, it goes to Active or back to
Idle.
3. Active
Explanation: The TCP connection failed, and the router is retrying. It’s waiting for the Connect-Retry timer
or listening for the other router to start the connection. If successful, it moves to OpenSent. If reset, it goes
back to Idle.
4. OpenSent
Explanation: The TCP connection is successful, and the router sends a BGP Open Message (like saying
“Hi!”). It waits for the other router’s Open Message. If it doesn’t get one, it stays here or resets to Idle.
5. OpenConfirm
Explanation: Both routers have sent and received Open Messages. They now wait for a Keepalive
message (like a “You still there?” ping). If the Keepalive is received, they move to Established.
6. Established
Explanation: The routers are fully connected as BGP peers. They can share routes (Update messages) and
send Keepalive messages to stay connected. If something fails (like a Notification message), they go back to
Idle.
➢ BGP MESSAGE TYPES
Question 1: What are the four main BGP message types used in its operations?
Answer: BGP uses four main message types to communicate between routers:
4. Notification ( Red): Sent when there's a problem, and it closes the connection
Simple Explanation:
Remember the colors: Green for Open (start), Blue for Update (info), Yellow for Keepalive (stay
connected), Red for Notification (problem). Think of a traffic light: Green starts, Yellow keeps going, Red
stops, and Blue is the info in between.
Question 2: What is the purpose of the BGP Open message, and what information does it include?
Answer:
The Open message ( Green) is the first message sent after two BGP routers are set up to talk. It helps them
become friends (establish a peering session). It includes:
• Hold-Time ( ): How long the router waits before thinking the connection is lost.
Plaintext Memory Tip:
V-A-R-H (Version, AS Number, Router ID, Hold-Time). Think "Very Amazing Router Handshake" to remember
what’s in an Open message.
Simple Explanation:
The Open message is like a handshake when two routers meet. It’s the first message sent to say, “Hey, let’s be
friends and share routes!” It tells the other router important details like who it is (Router ID), which group it
belongs to (AS Number), what version of BGP it’s using, and how long it will wait for a reply (Hold-Time).
Question 3: What does the BGP Update message do, and what does it contain?
Answer:
The Update message ( Blue) is used to share routing information between BGP routers. It contains:
• Path Attributes ( ): Extra details about the routes, like the next hop or origin.
Simple Explanation:
Think of the Update message as a newsletter. It tells your BGP friend, “Here’s a new way to get to this network,
and this old way doesn’t work anymore.” It’s like updating a map with new roads or crossing out closed ones.
Answer:
The Keepalive message ( Yellow) is a simple message sent to keep the BGP connection active. It’s like
saying, “I’m still here!” to the other router.
• The Hold Timer is 180 seconds ( ) by default, meaning if no Keepalive or Update is received in
180 seconds, the connection is considered down.(if no message is received in 180 seconds, the
connection is considered dead).
Simple Explanation:
The Keepalive message is like a heartbeat. Every 60 seconds, a router sends it to its BGP neighbor to say, “I’m
still here, don’t end our connection!” If the neighbor doesn’t hear anything for 180 seconds (the Hold Timer),
it assumes the router is gone and ends the connection.
Question 5: When is the BGP Notification message used, and what does it do?
Answer:
The Notification message ( Red) is sent when there’s a problem with the BGP connection, like a wrong AS
number or bad settings.
• It includes an error code ( ) to explain what went wrong (e.g., “Bad Peer AS”).
Simple Explanation:
Red ( ) means “stop” or “error.” Picture a red warning sign flashing when something goes wrong, like a
wrong AS number, and the connection shuts down.
Color-Coded Text Picture: