1. What is a Router?
Launch Routing SimA router is a Layer 3 (Network) device that connects two or more different networks. It acts as the "Traffic Controller" of the internet, reading IP addresses to decide where to send a packet next.
βοΈ Routing vs Switching
Switches connect devices inside a network (using MAC
addresses).
Routers connect different networks together (using IP addresses).
2. The Default Gateway
Think of the Default Gateway as the Exit Door of your network. If your computer wants to send data to an IP that is not on your local subnet, it sends it to the Default Gateway.
IPv4 Address. . . . . : 192.168.1.15
Subnet Mask . . . . . : 255.255.255.0
Default Gateway . . . : 192.168.1.1
π‘οΈ Attack Relevance
If an attacker can impersonate the Default Gateway (via ARP Spoofing), they can intercept and modify all outbound internet traffic from a target machine.
3. The Routing Table
Every router (and even your PC) maintains a routing tableβa map of where to send data based on the destination IP address.
Destination Gateway Genmask Flags Iface
0.0.0.0 192.168.1.1 0.0.0.0 UG eth0
192.168.1.0 0.0.0.0 255.255.255.0 U eth0
The entry 0.0.0.0 is the Default Route. It basically says: "If the
destination isn't local, send it to the gateway."
4. Static vs Dynamic Routing
How do routing tables get populated? There are two main methods:
- Static Routing: An administrator manually types the routes. Secure and simple, but doesn't scale for the whole internet.
- Dynamic Routing: Routers talk to each other using protocols (like OSPF, BGP, or RIP) to automatically find the fastest paths.
β οΈ BGP Hijacking
The entire internet runs on BGP (Border Gateway Protocol). If a malicious entity announces fake routes, they can "hijack" traffic meant for services like Google, redirecting it to their own servers.
5. Understanding NAT
Launch NAT VisualizerNetwork Address Translation (NAT) allows thousands of devices on a private network (like 192.168.x.x) to share a single public IP address provided by an ISP.
π Attacker Perspective: The NAT Shield
NAT acts as a basic one-way firewall. It's easy for internal devices to connect "out," but very hard for an internet attacker to connect "in" unless Port Forwarding is specifically configured.
π Module Recap
- Routers are the traffic directors of the internet (Layer 3).
- The Default Gateway is your route to the internet.
- Routing Tables map IP destinations to physical interfaces.
- NAT saves IPv4 space by translating private IPs to one public IP.