First, the essential ideas
- Network interface
- A network interface is a device's connection to a network, such as the wired connection on a computer. A physical port is the socket where its cable plugs in.
- IP address
- An IP address is a numerical address assigned to a network interface. It identifies where data is sent from or delivered to across connected networks.
- MAC address
- A MAC address is the local delivery address used by an Ethernet network interface. It helps deliver data across one local network, rather than choosing a route between networks.
- Packet
- An IP packet is a unit of data with source and destination IP addresses. IP addressing and routing are called Layer 3 functions.
- Frame
- An Ethernet frame is the local-delivery wrapper around an IP packet. Its source and destination MAC addresses apply to one local network. Ethernet framing is a Layer 2 function.
- Router
- A router is a device that moves IP packets between networks. It uses the destination IP address to select a route and the connection through which to send the packet.
- Segment
- A network segment is a group of devices that can communicate locally without crossing a router. This lesson uses two separate wired local networks, also called LANs.
- Default gateway
- A default gateway is the local router address a computer uses to reach other networks when it has no more specific route. Replies also need a working route back to their sender.
- Console
- A console is a text window for one device where you type a command and read its response. Always check the device name before typing.
- VPCS
- VPCS means Virtual PC Simulator. It provides the two small practice computers in this GNS3 lab. It accepts basic network commands in a console, but is not a full desktop operating system.
In this lab, EndpointA and EndpointB keep their source and destination IP addresses. Router1 removes the incoming Ethernet frame and creates a new one on its outgoing Ethernet interface. The new frame uses that interface's MAC address as its source and EndpointB's MAC address as its destination. Switch1 and Switch2 learn separate MAC-to-port tables on their own LANs; a switch does not share its table across Router1.
See the idea
One packet. Every wired step.
Switches forward local frames; Router1 routes the packet between networks; EndpointB receives it.
EndpointA to Switch1
EndpointA places the packet inside a local Ethernet frame. Switch1 reads the destination MAC address and forwards the frame toward Router1.
Full visual explanation and references
A packet travels from EndpointA through Switch1, Router1 and Switch2 to EndpointB. The diagram ends at EndpointB.
- EndpointA to Switch1
EndpointA places the packet inside a local Ethernet frame. Switch1 reads the destination MAC address and forwards the frame toward Router1.
www.cisco.com - Switch1 to Router1
Router1 removes the first LAN's frame and routes the IP packet. It creates a new frame on its outgoing Ethernet interface, using that interface's MAC as source and EndpointB's MAC as destination.
www.cisco.com - Router1 to EndpointB
Switch2 forwards the frame to EndpointB using its own local MAC table. The two switches learn independently on separate LANs; Router1 does not carry Switch1's table into Switch2. The diagram ends at EndpointB.
www.cisco.com
One idea at a time
Start with something familiar.
You know how computers talk to each other by sending data through cables connected to devices. You learned what an IP address is and how a device uses it to send or receive messages.
Why learn this?
Understanding how the devices between your computers decide where and how to send data helps you troubleshoot problems and design networks that work well.
An everyday comparison
Think of delivering letters in a neighborhood: houses, local mailboxes, and a post office each play a role in getting mail delivered.
What happens in a network
Endpoint computers are like houses, switches like local mailboxes sorting mail inside the neighborhood, and routers like post offices sending mail to other neighborhoods.
Where the comparison stopsUnlike real mail, network devices forward packets and frames only according to strict numerical address rules, never by human context or intent. The analogy breaks down because electronic devices cannot make exceptions or personal judgments.
Follow one worked example
- EndpointA wants to send data to EndpointB, so it creates an Ethernet frame with EndpointB's MAC address as destination.
EndpointA sends the frame to Switch1, which is connected directly by a cable.
Why: Switch1 reads the destination MAC address of the frame to decide which port to forward the frame out, because switches work at the local network level.
- Switch1 receives the frame and looks up EndpointB's MAC address in its forwarding table. It sees the router's port leads to EndpointB's network segment.
Switch1 sends the frame to Router1 through the port connected to it.
Why: Switches forward Ethernet frames based on MAC addresses within their network segment only; they do not route packets between networks.
- Router1 receives the frame and removes its Ethernet frame to check the IP packet inside.
Router1 looks at the destination IP address and sees it is in a different network segment than EndpointA.
Why: Routers work at the IP level, forwarding packets between different networks using IP addresses. The router does not use a MAC address to decide the outgoing port.
- Router1 creates a new Ethernet frame for EndpointB's network segment, using the MAC address of its outgoing interface as source and EndpointB's MAC as destination.
Router1 sends the frame to Switch2, connected to EndpointB.
Why: Routers must replace Layer 2 addresses when forwarding between different networks because MAC addresses are only valid within the local network.
- Switch2 receives the frame, looks up EndpointB's MAC address and forwards the frame to EndpointB.
EndpointB gets the frame, reads the data, and processes it.
Why: The local switch forwards frames by MAC address; EndpointB receives its data as the final destination device.
Your first small task
Set the IP address and default gateway on EndpointA and EndpointB in GNS3 using the given addresses, then ping EndpointB from EndpointA.
Show a hint
Right-click each endpoint in GNS3, open Console, type ip followed by the IP, mask, and gateway, then use ping <target IP> from EndpointA.
Check the expected result
Ping succeeds with replies, showing data travels both ways between the two computers.
Pause and explain it in your own words
Why does Router1 create a new Ethernet frame instead of forwarding the original one?
Show a hint
MAC addresses only have meaning within one local network segment. What must the router do to pass a packet to another network?
Show the explanation
Because MAC addresses only work within a single local segment, Router1 must replace the frame's source and destination MAC addresses to send the packet to the next segment. It keeps the IP addresses the same but rebuilds the Ethernet frame for the next hop.
Short answer
What should you understand today?
Routers move data between different networks by using IP addresses and creating new Ethernet frames with correct local MAC addresses. Switches forward Ethernet frames within a local network segment using MAC addresses. Endpoints are the devices that send and receive data using IP and MAC addresses.
Before you begin
Learning targets
- Day 1: Your first network — basics of IP addressing and network interfaces
- Basic understanding of IP addresses and subnet masks, including /24 notation
- Using GNS3 to open device consoles and run simple commands
- Explain function of endpoints, switches, routers, firewalls, and access points in forwarding
- Describe the difference between MAC and IP addresses and which device uses which
- Configure IP addresses and default gateways on endpoints in GNS3
- Verify connectivity between endpoints across two LAN segments via router
Words you will meet
Open a word when you need its meaning. You do not need to memorize the whole list before reading.
Frame
An Ethernet frame is a data unit containing MAC addresses used to deliver data within one local network.
Segment
A network segment is a group of devices that can communicate locally without needing a router.
Default gateway
The IP address of a local router interface where a device sends packets destined for other networks.
MAC address
A hardware address used for local delivery of Ethernet frames within one network.
IP address
A numerical address used to identify devices at the network layer across connected networks.
Router
A device that forwards IP packets between different network segments by selecting routes based on IP addresses.
Switch
A device that forwards Ethernet frames within a local network segment by using MAC address tables.
Endpoint
A device like a computer or virtual PC that sends and receives data on a network.
VPCS
Virtual PC Simulator, a simple emulated device in GNS3 used for learning networking commands.
Console
A text-based interface for typing commands and viewing responses on network devices.
Port
A port is a physical or logical connection point on a network device, where a cable is attached or data enters/leaves.
Forwarding table
A list used by a switch or router to decide where to send incoming frames or packets based on addresses.
Network Devices and Their Roles
Networks connect multiple devices to share data. Common devices include endpoints (computers), switches, routers, firewalls, and wireless access points. Each performs a unique job in deciding how and where to forward data through the network. The concepts of port (a physical connection point on a device), MAC address, and forwarding tables are introduced to show how each device organizes and delivers data.
- Endpoints are the source or destination of data.
- A port is a device's physical or logical connection point.
- Switches forward frames inside local networks using MAC address tables and local ports.
- Routers forward packets between different networks using IP addresses.
- Firewalls filter traffic based on policies (conceptual only).
- Access points bridge wireless clients into wired networks at Layer 2.
MAC Addresses and IP Addresses
Devices use MAC addresses to identify each other on a local network segment. IP addresses identify devices at the network layer across different connected local networks. Switches operate with MAC addresses and ports to forward data locally. Routers use IP addresses and routing tables to move data between networks. A router never uses a MAC address to determine where to forward packets.
- MAC addresses are used for local delivery within a LAN segment.
- Switches learn which MAC address is found on each physical port (within their own LAN only).
- IP addresses route data between networks.
- Default gateways on endpoints point to the local router's interface IP.
- Routers keep IP addresses the same, but rebuild the frame for the next segment.
Default Gateway and Network Segments
A default gateway is where an endpoint sends packets if their destination is outside the local subnet. Network segments (LANs) are groups of devices that communicate locally without needing a router.
- Network segments are separate local networks divided by routers.
- Endpoints send all non-local traffic to their default gateway, typically the local router interface.
- Routers connect segments and forward packets between them.
Wireless Access Points and Firewalls (Conceptual)
A wireless access point bridges wireless devices to the wired network at Layer 2, like a switch for radio signals. Access points do not route IP packets between subnets. Firewalls examine data and enforce rules to allow or block network traffic based on IP address, protocol, or application. Firewalls do not forward traffic based on MAC addresses at Layer 2. These functions are not simulated in the hands-on GNS3 lab, but it's helpful to understand their separate roles.
- Access points bridge wireless clients into wired LANs by forwarding frames at Layer 2.
- Access points do not forward data between wired network segments in this lab.
- Firewalls filter or permit traffic based on rules and inspection.
- Neither device is simulated in the wired GNS3 lab, but you will need to recognize their roles.
Understanding the Packet Journey in the Lab
In this guided lab, EndpointA sends a ping packet to EndpointB, crossing two LAN segments joined by Router1. Each network device in the path uses a different addressing and forwarding method. At each LAN, Switch1 or Switch2 learns which MAC addresses are found on which local ports. Router1 re-wraps the packet with a new Ethernet frame (with its own local source MAC and the final MAC for EndpointB) before sending the data into the new segment.
- Frames are reconstructed with new source and destination MAC on each segment.
- Packets keep their IP addresses end-to-end.
- Each switch only learns MACs seen on its segment.
- Router1 changes the Ethernet frame, not the IP packet.
- Lab topology uses two switches and one router connecting EndpointA and EndpointB.
- Paper prediction: After sending traffic, Switch1 will learn which port connects to EndpointA's or Router1's MAC address; Switch2 will learn which port connects to Router1 or EndpointB. Each switch does not know MAC addresses beyond its segment.
Real-world walkthrough
Fixing a Network Connection Problem Using Proper Gateway Settings
An office computer cannot reach a server on a different network. The network uses routers and switches similar to our lab. The network administrator suspects the default gateway is wrong.
- Administrator verifies the computer's IP and gateway settings.
- Sees the gateway is set to a wrong router IP not serving the endpoint's network.
- Changes the gateway to the correct router interface IP.
- Pings the server again and gets successful replies, confirming the fix.
Guided GNS3 lab
Lab: Forwarding Data Between Two LAN Segments Using Router and Switches
Configure IP addresses and default gateways on endpoints and router interfaces to enable inter-network communication. Verify connectivity with ping commands.
Addressing plan
| Device | Interface | Address | Purpose |
|---|---|---|---|
| EndpointA | VPCS interface | 10.1.1.10/24 | IP assigned to EndpointA on first LAN segment |
| Router1 | LAN1 (e.g., GigabitEthernet0/0) | 10.1.1.1/24 | Router interface on first LAN segment |
| Router1 | LAN2 (e.g., GigabitEthernet0/1) | 10.1.2.1/24 | Router interface on second LAN segment |
| EndpointB | VPCS interface | 10.1.2.10/24 | IP assigned to EndpointB on second LAN segment |
Set up the lab
- Interface mapping example: run show ip interface brief, then map the interface cabled to Switch1 as LAN1 and the interface cabled to Switch2 as LAN2. If the router shows GigabitEthernet0/0/0 and GigabitEthernet0/0/1, use the first for 10.1.1.1/24 and the second for 10.1.2.1/24. Substitute the displayed names in every interface command.
- Physically confirm wiring by tracing each cable from the router's named port to its attached switch and endpoint.
- Build topology in GNS3 as described.
- Connect EndpointA to Switch1 port1.
- Connect Switch1 port2 to Router1 LAN1 interface.
- Connect Router1 LAN2 interface to Switch2 port1.
- Connect Switch2 port2 to EndpointB.
Configure EndpointA IP and gateway
Right-click EndpointA and choose Console before typing. Enter: ip 10.1.1.10 255.255.255.0 10.1.1.1 and then show ip to verify.
ip 10.1.1.10 255.255.255.0 10.1.1.1
show ipWhat each command means
ip 10.1.1.10 255.255.255.0 10.1.1.1- Set IP address, subnet mask, and default gateway on EndpointA.
show ip- Display EndpointA's current IP configuration.
- What you should see
- EndpointA shows IP 10.1.1.10/24 with gateway 10.1.1.1.
- Why this step matters
- The IP and gateway identify which addresses are local and which are sent via the router.
Configure Router1 interfaces
Right-click Router1 and choose Console before typing. Enter: enable, configure terminal, interface GigabitEthernet0/0, ip address 10.1.1.1 255.255.255.0, no shutdown, exit, interface GigabitEthernet0/1, ip address 10.1.2.1 255.255.255.0, no shutdown, exit, end, show ip interface brief. Substitute interface names (e.g., GigabitEthernet0/0/0) if different.
enable
configure terminal
interface GigabitEthernet0/0
ip address 10.1.1.1 255.255.255.0
no shutdown
exit
interface GigabitEthernet0/1
ip address 10.1.2.1 255.255.255.0
no shutdown
exit
end
show ip interface briefWhat each command means
enable- Enter privileged EXEC mode for admin commands.
configure terminal- Enter configuration mode.
interface GigabitEthernet0/0- Select first LAN interface (to Switch1).
ip address 10.1.1.1 255.255.255.0- Assign first LAN IP and mask.
no shutdown- Enable interface for traffic.
exit- Exit interface config mode.
interface GigabitEthernet0/1- Select second LAN interface (to Switch2).
ip address 10.1.2.1 255.255.255.0- Assign second LAN IP and mask.
no shutdown- Enable second interface.
exit- Exit interface config mode.
end- Exit configuration to normal command mode.
show ip interface brief- Show each interface's status and IP for cable verification.
- What you should see
- Both interfaces display up and IP addresses match the intended LAN segments.
- Why this step matters
- Router1 needs IP addresses and working interfaces to move packets between networks.
Configure EndpointB IP and gateway
Right-click EndpointB and choose Console before typing. Enter: ip 10.1.2.10 255.255.255.0 10.1.2.1 and show ip to verify settings.
ip 10.1.2.10 255.255.255.0 10.1.2.1
show ipWhat each command means
ip 10.1.2.10 255.255.255.0 10.1.2.1- Set IP address, subnet mask, and default gateway on EndpointB.
show ip- Show EndpointB's configured IP and gateway.
- What you should see
- EndpointB shows IP 10.1.2.10/24 with gateway 10.1.2.1.
- Why this step matters
- Correct IP and gateway settings allow communication with other networks.
Test ping from EndpointA to EndpointB
Right-click EndpointA and choose Console before typing. Enter: ping 10.1.2.10 and observe results.
ping 10.1.2.10What each command means
ping 10.1.2.10- Send test packet from EndpointA to EndpointB.
- What you should see
- Ping replies received, confirming data successfully travels both ways.
- Why this step matters
- Shows that all forwarding and addressing is set up correctly.
Wrong-gateway experiment step 1: Set wrong gateway on EndpointB
Right-click EndpointB and choose Console before typing. Enter: ip 10.1.2.10 255.255.255.0 10.1.2.254 and then show ip to verify the change.
ip 10.1.2.10 255.255.255.0 10.1.2.254
show ipWhat each command means
ip 10.1.2.10 255.255.255.0 10.1.2.254- Set IP address and deliberately incorrect gateway on EndpointB.
show ip- Confirm new gateway setting is 10.1.2.254.
- What you should see
- EndpointB now has 10.1.2.10/24 and gateway 10.1.2.254.
- Why this step matters
- Simulates a common misconfiguration in real networks.
Wrong-gateway experiment step 2: Attempt ping from EndpointA to EndpointB
Right-click EndpointA and choose Console before typing. Enter: ping 10.1.2.10 and observe the result (expect no replies).
ping 10.1.2.10What each command means
ping 10.1.2.10- Test whether the echo reply can be delivered from EndpointB with the wrong gateway.
- What you should see
- Ping fails. No echo replies are received from EndpointB.
- Why this step matters
- With a wrong gateway, EndpointB receives but cannot reply across networks.
Wrong-gateway experiment step 3: Restore correct gateway on EndpointB
Right-click EndpointB and choose Console before typing. Enter: ip 10.1.2.10 255.255.255.0 10.1.2.1 and show ip to verify the fix.
ip 10.1.2.10 255.255.255.0 10.1.2.1
show ipWhat each command means
ip 10.1.2.10 255.255.255.0 10.1.2.1- Restore IP and the correct gateway to 10.1.2.1.
show ip- Verify gateway is now the router's LAN2 interface.
- What you should see
- Gateway is correct; ready for a new ping test.
- Why this step matters
- Restoring the gateway allows replies to route back through the router.
Wrong-gateway experiment step 4: Repeat ping from EndpointA to EndpointB
Right-click EndpointA and choose Console before typing. Enter: ping 10.1.2.10 and observe the reply.
ping 10.1.2.10What each command means
ping 10.1.2.10- Re-test connectivity after fixing the gateway.
- What you should see
- Ping succeeds, confirming bidirectional connectivity.
- Why this step matters
- Correct default gateway enables proper return path for the echo reply.
Map router interfaces to LANs
Right-click Router1 and choose Console before typing. On the Router1 console, run show ip interface brief. Confirm which interface is cabled to Switch1 as LAN1 and to Switch2 as LAN2 by checking up/up status and assigned IPs.
show ip interface briefWhat each command means
show ip interface brief- Displays a summary of all router interfaces and their assigned IPs and status.
- What you should see
- You can clearly see which port number matches which LAN segment and trace the corresponding cables.
- Why this step matters
- Wiring errors or interface confusion are common faults in both virtual and real networks.
Cleanup: Save router configuration
Right-click Router1 and choose Console before typing. Enter: enable, then copy running-config startup-config to save your configuration.
enable
copy running-config startup-configWhat each command means
enable- Enter privileged EXEC mode to allow saving.
copy running-config startup-config- Write all current settings to saved memory so they remain after a restart.
- What you should see
- Router displays a confirmation that configuration is saved.
- Why this step matters
- Prevents accidental settings loss between lab sessions.
Verify
- Successful ping replies from EndpointA to EndpointB.
- show ip on each endpoint reveals correct IP and gateway addresses.
- Router1 interfaces show up/up status and correct assignments as confirmed by show ip interface brief.
- When EndpointB uses the wrong gateway, ping fails; after restoring the correct gateway, ping succeeds.
Troubleshoot
- If ping fails, confirm IP and subnet mask on both endpoints.
- Check default gateway on both endpoints matches the router interface of the correct LAN.
- On Router1, check show ip interface brief to confirm interfaces are up and correct IPs.
- Physically trace each cable in the topology to matching ports, especially after interface name substitutions.
GNS3 does not provide Cisco software images. Use a Cisco image only when the applicable Cisco license or entitlement legally permits that use, and do not share or redistribute Cisco image files. Cisco CML reference-platform images are licensed for use within CML unless a separate license permits outside use. Cisco Modeling Labs is the official alternative; built-in VPCS and Ethernet switch nodes do not require a Cisco image.
- Save router config using copy running-config startup-config.
- Close GNS3 consoles and stop devices as needed.
Practice set
Answer before you reveal
01What address does a switch use to decide where to forward a frame?
Switches operate at Layer 2 and forward frames based on MAC addresses within one local network segment.
02Why does Router1 replace Ethernet frame addresses when forwarding a packet?
Routers work at Layer 3, forwarding packets between networks; Layer 2 frames are rebuilt for each hop.
03What is the role of the default gateway setting on an endpoint?
Without the default gateway, endpoints cannot reach devices on other networks.
04What happens when a ping fails due to a wrong default gateway on EndpointB?
The incorrect gateway breaks the return path for the reply packet.
05Can wireless access points be simulated in this wired GNS3 lab?
This lab focuses on wired device roles; access points bridge wireless clients onto wired networks conceptually.
06How does a router decide where to forward an IP packet?
Routing is based on IP addresses and network prefixes at Layer 3.
Knowledge check
Quiz: prove the reasoning
Keep these
Technical takeaways
- Network devices forward data differently based on their role: endpoints send and receive, switches forward frames locally using MAC addresses and ports, routers move packets between networks using IP addresses.
- MAC addresses are used to forward frames inside local networks; IP addresses are used by routers to forward between networks.
- Endpoints use default gateways to send data to other networks; incorrect gateways cause communication failure, even if requests arrive.
- In this lab, switches, routers, and endpoints are modeled with specific IP and MAC configurations to explore forwarding.
- Wireless access points and firewalls are conceptually explained but not simulated in this wired lab.
- Understanding each device's role and addresses helps in configuring networks and troubleshooting connectivity issues.
