---
description: Nerd Cafe
---

# Router

### <mark style="color:blue;">**Function**</mark><mark style="color:blue;">:</mark>&#x20;

<mark style="color:red;">**Layer 3**</mark> device that makes forwarding decisions based on <mark style="color:red;">**logical network addresses**</mark> (e.g., IP addresses).

### <mark style="color:blue;">**Key Features**</mark><mark style="color:blue;">:</mark>

* Segments networks by not forwarding broadcast packets by default, creating <mark style="color:red;">**separate broadcast domains per port**</mark>.
* Each port also creates a separate <mark style="color:red;">**collision domain**</mark>, enhancing network efficiency.
* Supports advanced features like QoS for traffic prioritization.

### <mark style="color:blue;">Topology</mark>

<figure><img src="https://2804731566-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLOszSitBb46QATDLUtW4%2Fuploads%2FouXBL1kKr2uvxFvRSWjK%2F0559.png?alt=media&#x26;token=ca739e95-3b6a-4093-8905-5d8e681fecb4" alt=""><figcaption></figcaption></figure>

### <mark style="color:blue;">Summary Table of IP Assignments</mark>

| Device | Interface | IP Address	  | Subnet         |
| ------ | --------- | ------------ | -------------- |
| Router | fa0/0     | 192.168.1.1  | 192.168.1.0/24 |
| Router | fa0/1     | 192.168.2.1  | 192.168.2.0/24 |
| PC0    | NIC       | 192.168.1.10 | 192.168.1.0/24 |
| PC1    | NIC       | 192.168.1.11 | 192.168.1.0/24 |
| PC2    | NIC       | 192.168.2.10 | 192.168.2.0/24 |
| PC3    | NIC       | 192.168.2.11 | 192.168.2.0/24 |

### <mark style="color:blue;">Configure the Router Interfaces</mark>

```
Router>enable 
Router#configure terminal 
Router(config)#interface fastEthernet 0/0
Router(config-if)#ip address 192.168.1.1 255.255.255.0
Router(config-if)#no shutdown 
Router(config-if)#exit
Router(config)#interface fastEthernet 0/1
Router(config-if)#ip address 192.168.2.1 255.255.255.0
Router(config-if)#no shutdown 
Router(config-if)#^Z
Router#show ip route 
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
       * - candidate default, U - per-user static route, o - ODR
       P - periodic downloaded static route

Gateway of last resort is not set

C    192.168.1.0/24 is directly connected, FastEthernet0/0
C    192.168.2.0/24 is directly connected, FastEthernet0/1
Router#
```

### <mark style="color:blue;">Test Connectivity</mark>

On a PC, open **Command Prompt** → ping the other subnet:

```
PC>ping 192.168.2.10

Pinging 192.168.2.10 with 32 bytes of data:

Reply from 192.168.2.10: bytes=32 time=0ms TTL=127
Reply from 192.168.2.10: bytes=32 time=0ms TTL=127
Reply from 192.168.2.10: bytes=32 time=0ms TTL=127
Reply from 192.168.2.10: bytes=32 time=0ms TTL=127

Ping statistics for 192.168.2.10:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms

PC>
```

### <mark style="color:blue;">**Congratulations!**</mark>

You have built a two-subnet, router-on-a-stick-style topology in Packet Tracer, perfect for practicing basic routing between LANs.

