CCNA · Domain 3 of 6 · 25% of the exam

CCNA Domain 3: IP Connectivity

50 free practice questions for IP Connectivity in the Cisco Certified Network Associate (CCNA 200-301) exam. Try each question first, then open "Show answer" for the correct option and explanation.

IP Connectivity practice questions

  1. Question 1. A router has routes to 10.1.0.0/16, 10.1.1.0/24, and 10.1.1.0/26. Which route is used for a packet to 10.1.1.20?

    1. 10.1.0.0/16
    2. 10.1.1.0/24
    3. 10.1.1.0/26
    4. The default route
    Show answer

    Answer: C. 10.1.1.0/26

    Routers use the longest prefix match, the most specific route containing the destination.

  2. Question 2. A router learns the same prefix from OSPF and from EIGRP. Which route is installed, with default settings?

    1. The OSPF route, because OSPF is an open standard
    2. Both routes, with traffic load-balanced between them
    3. The EIGRP route, because its administrative distance is lower
    4. The route with the lowest metric regardless of protocol
    Show answer

    Answer: C. The EIGRP route, because its administrative distance is lower

    Internal EIGRP has an AD of 90 and OSPF 110. Lower AD wins between different sources; metrics compare routes within one protocol.

  3. Question 3. What is the default administrative distance of a static route?

    1. 0
    2. 110
    3. 1
    4. 120
    Show answer

    Answer: C. 1

    Directly connected routes are 0 and static routes are 1. OSPF is 110 and RIP is 120.

  4. Question 4. What is the default administrative distance of OSPF?

    1. 90
    2. 100
    3. 120
    4. 110
    Show answer

    Answer: D. 110

    OSPF's AD is 110, higher than EIGRP (90) and lower than RIP (120).

  5. Question 5. In the output of show ip route, what does the code "O" indicate?

    1. A route learned through OSPF
    2. A route from the ODR protocol only
    3. A directly connected route
    4. A static route
    Show answer

    Answer: A. A route learned through OSPF

    O marks OSPF routes (O IA for inter-area). C is connected, S is static, and D is EIGRP.

  6. Question 6. In the route entry O 10.2.2.0/24 [110/20] via 192.168.1.2, what does 20 represent?

    1. The administrative distance
    2. The hop count to the destination
    3. The OSPF metric (cost) of the route
    4. The age of the route in seconds
    Show answer

    Answer: C. The OSPF metric (cost) of the route

    The bracketed values are [administrative distance/metric].

  7. Question 7. What is the "gateway of last resort" in a routing table?

    1. The next hop of the default route
    2. The first route learned after boot
    3. The router with the highest router ID
    4. The route with the lowest metric
    Show answer

    Answer: A. The next hop of the default route

    The gateway of last resort is used when no more specific route matches.

  8. Question 8. Which command configures an IPv4 default static route pointing to next hop 203.0.113.1?

    1. ip route 0.0.0.0 0.0.0.0 203.0.113.1
    2. ip route 255.255.255.255 0.0.0.0 203.0.113.1
    3. ip default-network 203.0.113.1 0.0.0.0
    4. ip route default 203.0.113.1 255.0.0.0
    Show answer

    Answer: A. ip route 0.0.0.0 0.0.0.0 203.0.113.1

    0.0.0.0/0 matches every destination and is used when nothing more specific exists.

  9. Question 9. Which command creates an IPv6 default route to next hop 2001:DB8::1?

    1. ipv6 route 0.0.0.0/0 2001:DB8::1
    2. ipv6 route ::/0 2001:DB8::1
    3. ipv6 default-route 2001:DB8::1
    4. ip route ::/128 2001:DB8::1
    Show answer

    Answer: B. ipv6 route ::/0 2001:DB8::1

    ::/0 is the IPv6 default route. ipv6 unicast-routing must also be enabled.

  10. Question 10. A backup static route should be used only if the OSPF-learned route fails. How should it be configured?

    1. As a floating static route with an administrative distance above 110
    2. As a static route with an administrative distance of 1
    3. As a host route with a /32 mask
    4. With the permanent keyword and no next hop
    Show answer

    Answer: A. As a floating static route with an administrative distance above 110

    A floating static route has a higher AD than the primary route, so it's installed only when the primary disappears.

  11. Question 11. What is a host route in IPv4?

    1. A route that points to the default gateway
    2. A route to a single address, with a /32 mask
    3. A route learned from a host's DHCP server
    4. A route with an administrative distance of 0
    Show answer

    Answer: B. A route to a single address, with a /32 mask

    Host routes use /32 (or /128 in IPv6) to match exactly one address.

  12. Question 12. When a static route uses only an exit interface on an Ethernet link, what can happen?

    1. The router must ARP for every destination, relying on proxy ARP
    2. The route is removed from the routing table immediately
    3. The route becomes a floating static route
    4. The route is advertised automatically in OSPF
    Show answer

    Answer: A. The router must ARP for every destination, relying on proxy ARP

    On multi-access links, specifying a next-hop address (or both) avoids reliance on proxy ARP.

  13. Question 13. Which IPv6 next hop must be combined with an exit interface in a static route?

    1. A global unicast address
    2. A link-local address
    3. A unique local address
    4. An anycast address
    Show answer

    Answer: B. A link-local address

    Link-local addresses are only unique on a link, so the router needs the exit interface to use them.

  14. Question 14. How does OSPF choose the router ID if none is configured manually?

    1. The highest IPv4 address on a loopback, or else on an active interface
    2. The lowest MAC address on the router
    3. The IP address of the first interface configured
    4. A random number chosen at boot
    Show answer

    Answer: A. The highest IPv4 address on a loopback, or else on an active interface

    A manual router-id wins. Otherwise the highest loopback address is used, then the highest active physical interface address.

  15. Question 15. Which OSPF packet type is used to discover and maintain neighbors?

    1. Hello
    2. LSU
    3. LSAck
    4. DBD
    Show answer

    Answer: A. Hello

    Hello packets discover neighbors and act as keepalives. DBD, LSR, LSU, and LSAck exchange the link-state database.

  16. Question 16. Two OSPF routers on the same link will not become neighbors. Which mismatch prevents adjacency?

    1. Different router IDs
    2. Different interface descriptions
    3. Different hello and dead timers
    4. Different hostnames
    Show answer

    Answer: C. Different hello and dead timers

    Hello/dead timers, area ID, subnet, authentication, and stub flags must match. Router IDs must be different.

  17. Question 17. Which OSPF neighbor state indicates the routers have fully synchronized their databases?

    1. Full
    2. 2-Way
    3. ExStart
    4. Init
    Show answer

    Answer: A. Full

    Full means the adjacency is complete. On broadcast networks, DROthers stay in 2-Way with each other.

  18. Question 18. On an Ethernet broadcast segment, why does OSPF elect a DR and BDR?

    1. To choose which router forwards all user traffic
    2. To assign IP addresses to other routers
    3. To reduce the number of adjacencies and LSA flooding
    4. To select the router ID for the area
    Show answer

    Answer: C. To reduce the number of adjacencies and LSA flooding

    Routers form full adjacencies only with the DR and BDR, which reduces overhead on multi-access networks.

  19. Question 19. How is the OSPF designated router elected?

    1. Lowest interface priority, then lowest router ID
    2. Highest interface priority, then highest router ID
    3. The router with the most neighbors
    4. The router with the fastest interface
    Show answer

    Answer: B. Highest interface priority, then highest router ID

    Priority 0 means the router never becomes DR. The election isn't preemptive, so a new higher-priority router won't take over.

  20. Question 20. Which command stops a router from ever becoming the DR on an interface?

    1. ip ospf cost 0
    2. passive-interface on that interface
    3. ip ospf priority 0
    4. ip ospf hello-interval 0
    Show answer

    Answer: C. ip ospf priority 0

    Priority 0 excludes the router from DR and BDR elections.

  21. Question 21. Which OSPF network type has no DR/BDR election and is common on serial or directly connected router links?

    1. Broadcast
    2. Non-broadcast multi-access
    3. Point-to-point
    4. Point-to-multipoint with DR
    Show answer

    Answer: C. Point-to-point

    Point-to-point networks form a single adjacency, so no DR is needed. Setting Ethernet links between two routers to point-to-point speeds up adjacency.

  22. Question 22. How is OSPF cost calculated by default on Cisco routers?

    1. Hop count to the destination
    2. Delay plus reliability of the path
    3. Interface bandwidth multiplied by delay
    4. Reference bandwidth divided by interface bandwidth
    Show answer

    Answer: D. Reference bandwidth divided by interface bandwidth

    The default reference bandwidth is 100 Mbps, so all links of 100 Mbps and faster get cost 1 unless the reference is raised.

  23. Question 23. What does the passive-interface command do in OSPF?

    1. Removes the interface's network from OSPF entirely
    2. Stops sending hellos on the interface while still advertising its network
    3. Makes the interface the DR automatically
    4. Sets the interface cost to zero
    Show answer

    Answer: B. Stops sending hellos on the interface while still advertising its network

    Passive interfaces are used on LAN interfaces with no routers, preventing unwanted adjacencies.

  24. Question 24. Which command enables OSPF on all interfaces with addresses in 10.0.0.0/8, in area 0?

    1. network 10.0.0.0 255.0.0.0 area 0
    2. network 10.0.0.0 0.255.255.255 area 0
    3. ip ospf 10.0.0.0 area 0
    4. router ospf 10.0.0.0 area 0
    Show answer

    Answer: B. network 10.0.0.0 0.255.255.255 area 0

    The network command uses a wildcard mask. Alternatively, ip ospf 1 area 0 can be set per interface.

  25. Question 25. In a single-area OSPF design, which area must be used?

    1. Area 1
    2. Any area number
    3. Area 255
    4. Area 0, the backbone
    Show answer

    Answer: D. Area 0, the backbone

    Single-area designs commonly use area 0. In multi-area designs, all areas must connect to area 0.

  26. Question 26. What is the purpose of a first hop redundancy protocol (FHRP)?

    1. Provide a backup default gateway that hosts use without reconfiguration
    2. Load-balance traffic between internet providers
    3. Distribute routes between OSPF areas
    4. Assign IPv6 addresses to hosts
    Show answer

    Answer: A. Provide a backup default gateway that hosts use without reconfiguration

    FHRPs share a virtual IP and MAC between routers, so the gateway survives a router failure.

  27. Question 27. Which FHRP is Cisco proprietary and uses an active and a standby router?

    1. VRRP
    2. HSRP
    3. GLBP only
    4. CARP
    Show answer

    Answer: B. HSRP

    HSRP uses active and standby roles. VRRP is the open standard with master and backup roles.

  28. Question 28. Which FHRP is an open standard?

    1. HSRP
    2. GLBP
    3. VRRP
    4. CDP
    Show answer

    Answer: C. VRRP

    VRRP is defined by the IETF. HSRP and GLBP are Cisco proprietary.

  29. Question 29. Which FHRP can load-balance traffic from hosts across several gateway routers using one virtual IP?

    1. GLBP
    2. HSRP version 1
    3. VRRP
    4. Proxy ARP
    Show answer

    Answer: A. GLBP

    GLBP gives different hosts different virtual MACs so several routers forward traffic at once.

  30. Question 30. In HSRP, what happens by default when a higher-priority router comes back online after a failure?

    1. It immediately takes over as active
    2. It shuts down the current active router
    3. It stays standby unless preemption is configured
    4. It forms a new HSRP group
    Show answer

    Answer: C. It stays standby unless preemption is configured

    HSRP doesn't preempt by default. The standby preempt command lets the higher-priority router reclaim the active role.

  31. Question 31. What is the default HSRP priority?

    1. 100
    2. 0
    3. 1
    4. 255
    Show answer

    Answer: A. 100

    The highest priority becomes active. On a tie, the highest IP address wins.

  32. Question 32. What IP address do hosts use as their default gateway in an HSRP group?

    1. The virtual IP address shared by the group
    2. The real interface address of the active router
    3. The address of the standby router
    4. The broadcast address of the subnet
    Show answer

    Answer: A. The virtual IP address shared by the group

    Hosts point to the virtual IP, which moves between routers as roles change.

  33. Question 33. A router has two routes to the same prefix from OSPF with equal cost. What does it do by default?

    1. Uses only the route learned first
    2. Uses the route with the lower next-hop address
    3. Discards both routes
    4. Installs both and load-balances across them
    Show answer

    Answer: D. Installs both and load-balances across them

    OSPF supports equal-cost multipath. Cisco routers install up to 4 equal-cost paths by default.

  34. Question 34. Which command shows OSPF neighbors and their states?

    1. show ip route ospf only
    2. show ip protocols neighbors
    3. show ip ospf neighbor
    4. show cdp neighbors detail
    Show answer

    Answer: C. show ip ospf neighbor

    show ip ospf neighbor lists neighbor router IDs, priority, state, and interface.

  35. Question 35. A router's routing table has no route for a destination and no default route. What happens to the packet?

    1. It is flooded out all interfaces
    2. It is sent to the router with the highest router ID
    3. It is dropped and an ICMP unreachable message may be sent
    4. It is held in the buffer until a route appears
    Show answer

    Answer: C. It is dropped and an ICMP unreachable message may be sent

    Without a matching route, the packet is discarded.

  36. Question 36. What does the routing table code "L" represent in Cisco IOS?

    1. A route learned from LLDP neighbor messages
    2. The router's own interface address, as a /32 route
    3. A route with a longer prefix than the default
    4. A route learned from any link-state protocol
    Show answer

    Answer: B. The router's own interface address, as a /32 route

    L routes are the router's own addresses. C routes are the connected networks.

  37. Question 37. Which statement about OSPF is correct?

    1. It is a distance-vector protocol that uses hop count
    2. It is a link-state protocol that uses Dijkstra's SPF algorithm
    3. It is a path-vector protocol used between ISPs
    4. It sends its full routing table every 30 seconds
    Show answer

    Answer: B. It is a link-state protocol that uses Dijkstra's SPF algorithm

    OSPF routers build a link-state database and run SPF to calculate best paths. RIP sends periodic full updates.

  38. Question 38. Which multicast address do OSPF routers use to send hellos to all OSPF routers?

    1. 224.0.0.6
    2. 224.0.0.9
    3. 224.0.0.5
    4. 255.255.255.255
    Show answer

    Answer: C. 224.0.0.5

    224.0.0.5 is AllSPFRouters. 224.0.0.6 is used to reach the DR and BDR.

  39. Question 39. An OSPF router sits in the ExStart state with a neighbor. What is a common cause?

    1. An MTU mismatch between the two interfaces
    2. Mismatched router hostnames
    3. Different CDP versions
    4. Different enable passwords
    Show answer

    Answer: A. An MTU mismatch between the two interfaces

    Routers can get stuck in ExStart/Exchange when their interface MTUs differ.

  40. Question 40. Which command changes the reference bandwidth so 10 Gbps and 1 Gbps links get different OSPF costs?

    1. auto-cost reference-bandwidth 10000
    2. bandwidth 10000000
    3. ip ospf cost 10000 on every router
    4. ospf reference 10 gigabit
    Show answer

    Answer: A. auto-cost reference-bandwidth 10000

    Setting the reference bandwidth (in Mbps) higher than the fastest link gives faster links lower costs. It should match on all routers.

  41. Question 41. Which route source is always preferred when the same prefix is learned several ways?

    1. A directly connected network
    2. A static route with AD 1
    3. An EIGRP internal route
    4. An OSPF route
    Show answer

    Answer: A. A directly connected network

    Connected routes have an administrative distance of 0, the most trusted source.

  42. Question 42. What happens when a packet's TTL reaches zero at a router?

    1. The router resets the TTL and forwards it
    2. The router sends it to the default gateway
    3. The router drops it and sends an ICMP time exceeded message
    4. The router floods it out all interfaces
    Show answer

    Answer: C. The router drops it and sends an ICMP time exceeded message

    TTL prevents packets from looping forever. Traceroute uses these ICMP messages to map the path.

  43. Question 43. Before forwarding a packet on Ethernet, what does a router need to learn about the next hop?

    1. Its OSPF router ID, from the neighbor table
    2. Its hostname, through a DNS lookup
    3. Its MAC address, through ARP or IPv6 neighbor discovery
    4. Its own default gateway address, through DHCP
    Show answer

    Answer: C. Its MAC address, through ARP or IPv6 neighbor discovery

    The router rewrites the layer 2 header with the next hop's MAC address on each hop.

  44. Question 44. Which statement about the IP header as a packet crosses several routers is correct?

    1. The IP addresses change at each hop, but the MAC addresses stay the same
    2. The source and destination IP addresses stay the same, but the MAC addresses change
    3. Both the IP and MAC addresses stay the same end to end
    4. Both the IP and MAC addresses change at each hop
    Show answer

    Answer: B. The source and destination IP addresses stay the same, but the MAC addresses change

    Without NAT, IP addresses stay end to end. Layer 2 addresses are rewritten on each link.

  45. Question 45. What does the command ip route 192.168.50.0 255.255.255.0 10.0.0.2 200 create?

    1. A static route with a metric of 200
    2. A static route that expires after 200 seconds
    3. A static route with an administrative distance of 200
    4. A static route that allows 200 hops
    Show answer

    Answer: C. A static route with an administrative distance of 200

    The trailing number sets the AD, making this a floating static route.

  46. Question 46. Which command enables IPv6 routing on a Cisco router?

    1. ipv6 enable routing
    2. ipv6 unicast-routing
    3. ip routing ipv6
    4. router ipv6
    Show answer

    Answer: B. ipv6 unicast-routing

    Without ipv6 unicast-routing, the router won't forward IPv6 packets between interfaces.

  47. Question 47. Which protocol type does OSPFv3 route?

    1. Only IPv4 unicast prefixes
    2. IPv6, and IPv4 through address families
    3. Only MPLS labels between routers
    4. Only multicast group traffic
    Show answer

    Answer: B. IPv6, and IPv4 through address families

    OSPFv3 was built for IPv6 and can carry IPv4 through address families.

  48. Question 48. Which OSPF router role on a broadcast segment takes over if the DR fails?

    1. A DROther
    2. The ABR
    3. The BDR
    4. The ASBR
    Show answer

    Answer: C. The BDR

    The backup designated router is already fully adjacent with all routers, so it can take over quickly.

  49. Question 49. Why is a loopback interface commonly used for the OSPF router ID?

    1. It has the highest bandwidth of any interface
    2. It is always up, so the router ID stays stable
    3. It is the only interface that can run OSPF
    4. It prevents OSPF from forming adjacencies
    Show answer

    Answer: B. It is always up, so the router ID stays stable

    A loopback doesn't go down with a physical link, so it provides a stable identity. Configuring router-id explicitly is also common.

  50. Question 50. What does the "via" address in a routing table entry indicate?

    1. The router's own interface address
    2. The next-hop router's IP address
    3. The destination network address
    4. The DNS server for the route
    Show answer

    Answer: B. The next-hop router's IP address

    The next hop is where the router sends packets to reach that destination.

Cisco and CCNA are trademarks or registered trademarks of Cisco Systems, Inc. These questions are original study material, not questions from the real exam.