1

When looking at a device's routing table, can you tell whether it is a gateway device between some networks or if it is not a gateway device?

7

You can’t tell. There will be entries for the local networks, but there may or may not be additional routes.

If the device is configured to forward packets from one interface to another, it’s a good bet someone is using it as a gateway.

  • 1
    Thanks. What does "forward packets from one interface to another" look like in a routing table? – Tim Mar 27 at 23:00
  • 1
    The routing table is independent of whether the device is forwarding or not. For a simple device with two interfaces, there will be an entry for each in the routing table. – Ron Trunk Mar 27 at 23:04
  • @Tim: It's not in the routing table, it's a different part of a host's configuration. On a Cisco router it's ip forwarding (which is usually enabled by default and so only normally visible with show run all) and on a Unix-style computer it would be net.ipv4.ip_forward = 1 in sysctl -a output. Other operating systems, and IPv6, have analagous mechanisms. – jonathanjo Mar 28 at 12:11
  • The definitive answer about gateway is definitely about IP forwarding, but nonetheless it's true that most hosts have a single active interface and very short routing tables (usually one per interface and a default), and almost all non-domestic gateways have at least two interfaces and longer routing tables. You can't be certain but you can almost always guess from the routing table. And certainly you can tell from the usual printed format if it was say Cisco or Unix, which is another good clue. But the definitive answer is as Ron T says. – jonathanjo Mar 28 at 12:18
-3

You can do a show ip route (on cisco devices) or any other similar command on other devices and you will get the gateway of last resort for the specific network.

  • "you will get the gateway of last resort for the specific network." That assumes one is configured on the device. For example, you will find a lot of ISP (and some large business) routers do not implement a default route because they have the full Internet routing table. – Ron Maupin Mar 28 at 1:01
  • Look at the answers to this question. – Ron Maupin Mar 28 at 1:03
  • True, in the case of large networks and/or with powerful routers with full routing tables, there is no need for last resort gateway. – Antelope Network Corp. Mar 28 at 1:07
  • It can also be the case for devices which don't need to reach the entire world, but just need one specific route to reach some other systems they need to interact with. – Teun Vink Mar 28 at 5:36
  • In addition: how does your answer help with what the poster asked? You can only determine if another device is the gateway that way. – Teun Vink Mar 28 at 5:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.