In networking, routers and gateways serve distinct but complementary functions. A router is a device that forwards packets between networks, while a gateway is essentially the IP address of the router interface that serves as the access point to another network.
When your system only has the gateway configured (67.23.27.1 in your example), it uses Address Resolution Protocol (ARP) to discover the MAC address of the gateway, which is actually the router's interface in your local network.
Here's what happens behind the scenes:
1. System checks routing table for destination network
2. If no specific route exists, it uses the default route (gateway)
3. ARP request is sent to resolve gateway's MAC address
4. Router responds with its interface MAC (67.23.27.187 in your trace)
5. Packets are forwarded to the router's physical interface
Let's examine this with common Linux networking commands:
# View the routing table
$ ip route show
default via 67.23.27.1 dev eth0
67.23.27.0/24 dev eth0 proto kernel scope link src 67.23.27.187
# ARP cache showing the resolved MAC
$ arp -n
Address HWtype HWaddress Flags Mask Iface
67.23.27.1 ether 00:1a:2b:3c:4d:5e C eth0
The discrepancy between your gateway (67.23.27.1) and first hop (67.23.27.187) occurs because:
- The gateway IP is the router's management/configured interface
- The router may have multiple interfaces or use NAT
- Your system (67.23.27.187) and gateway are on the same subnet
Here's how a typical network might be configured:
# /etc/network/interfaces on Debian-based systems
auto eth0
iface eth0 inet static
address 67.23.27.187
netmask 255.255.255.0
gateway 67.23.27.1
dns-nameservers 8.8.8.8 8.8.4.4
The actual packet flow looks like this:
[Your PC: 67.23.27.187]
→ (via ARP to 67.23.27.1)
→ [Router Interface: 67.23.27.1]
→ [Router Forwarding: 67.23.27.187]
→ Next hop
You can explicitly add routes to see how this works:
# Add a specific route through the gateway
$ ip route add 192.168.1.0/24 via 67.23.27.1 dev eth0
# Verify route
$ ip route get 192.168.1.5
192.168.1.5 via 67.23.27.1 dev eth0 src 67.23.27.187
In your network trace example, we observe a clear separation between the gateway (67.23.27.1) and the first hop router (67.23.27.187). The fundamental difference lies in their operational layers:
- Gateway: Operates at multiple OSI layers (typically layers 3-7), often performing protocol translation between different network architectures
- Router: Primarily operates at layer 3, making forwarding decisions based on IP addresses
When your system only has the gateway configured (as shown in your /etc/sysconfig/network
), it uses several mechanisms to discover the router:
# ARP resolution process example
arp -a # Shows learned MAC addresses
ip route show # Displays the routing table
Here's how you might configure these elements in different environments:
Linux static route configuration:
# Add a specific route through gateway
ip route add 192.168.1.0/24 via 67.23.27.1 dev eth0
# Default route configuration (common in /etc/network/interfaces)
auto eth0
iface eth0 inet static
address 67.23.27.187
netmask 255.255.255.0
gateway 67.23.27.1
The communication flow between your host and the first router involves:
- Host checks its routing table for destination
- If no specific route exists, uses default gateway
- ARP resolution occurs if gateway MAC isn't cached
- Packets are forwarded to gateway, which then routes to next hop
Example packet flow:
# tcpdump output showing gateway interaction
tcpdump -i eth0 host 67.23.27.1 and host 67.23.27.187
In enterprise networks, you might encounter more complex relationships between gateways and routers:
# Multi-homed host configuration example
ip route add default via 67.23.27.1 metric 100
ip route add default via 67.23.27.2 metric 200
Key troubleshooting commands:
netstat -rn
traceroute -n google.com
ip neigh show