0

Does a gateway need to be designated?

I thought a gateway between two networks is a device explicitly designated to be a gateway, out of several qualified devices connected to both networks. That was my impression when I heard that I could find out gateways from a routing table (e.g. from the output of route -n).

But now suppose that I am to create a new network, and add a line to the routing table of a host, so I have to pick a gateway, without looking up the routing table.

Is any device which satisfies the following two conditions already a gateway between two networks without being explicitly designated:

  • with two network interfaces connected to the networks respectively, and

  • with a routing table allowing packets to be transmitted from a network to the other (Is it correct that every device in network(s) has a routing table?)

?

Thanks.

  • 1
    This really becomes a functional definition. If you're using it as a gateway, meaning you have other devices that use this device to get to other networks, then it's a gateway. – Ron Trunk Mar 27 at 12:03
  • by "functional" definition, do you mean "it is currently being used as" or "it has all the qualifications and can be used as, even if not being used as"? – Tim Mar 27 at 12:43
  • Tim, consider joining Network Engineering Chat. You might get your questions answer more completely and more quickly. chat.stackexchange.com/rooms/11177/… – Ron Trunk Mar 27 at 13:21
4

The device meets the minimum requirements to be a gateway, but I would say if you’re not using it as a gateway, then it’s not a gateway.

  • Thanks. What are "using it as a gateway" and not "using it as a gateway"? – Tim Mar 27 at 2:31
  • Is a gateway a undirectional or directional concept? In other words, is a gateway for two networks, or from a network to a second network? – Tim Mar 27 at 3:01
  • I have updated my post. Thanks. – Tim Mar 27 at 11:42
  • (1) "The device meets the minimum requirements to be a gateway", do you mean any gateway has to at least satisfy the two conditions that I listed? (2) in "but I would say if you’re not using it as a gateway, then it’s not a gateway", what do you mean by "using it as a gateway" ? – Tim Mar 27 at 12:47
  • 1. As a functional definition of a gateway I would say yes. 2. If no device has the gateway listed in its routing table, then it's not being used as a gateway. Is your PC a server if no one uses it as such? – Ron Trunk Mar 27 at 12:51
6

This is more a semantic thing than a technical one.

An IP network, like 192.168.1.0/24 usually contains several hosts. An host can be -among other things- a computer, a printer or a router. Yes, a router is also an host in IP terminology.

When a non-router host, let's call it X, want to communicate with another host that is not in the local network, it has to send the traffic to a router.

So X lookup in its own IP routing table and search for a route. If a route exists for the destination it seeks, X sends the packet to the router given by the route.

A host can have several routes to different destinations pointing to different routers in the same LAN.

However this imply for the administrators to maintain on each and every host a routing table. This is really impractical.

So usually a standard host has only one route, to a single router, and this router will forward (or redirect) traffic to other routers as needed.

This is this unique router that is called the gatewayused by host X.

The gateway of a network is the router that hosts in this network have as router / default gateway / default router in their IP settings.

This is a host related concept. For a router there's not really a concept of gateway.

  • It is as you say really a semantic question, but I'd have said that as a matter of implementation most hosts actually have a an interface route as well as a default route. For explanatory power I'd also say that "routing table" is a much better explanation that "LAN-mechanism and Gateway-mechanism". – jonathanjo Mar 28 at 12:26
  • @jonathanjo agree, but considering the various questions asked by the OP, I choose to leave aside technicalities that would be more confusing than helping, IMO. – JFL Mar 28 at 12:33
2

Each and every device has no routing table. Every layer 3 device has a routing table.

Gateway is physical device or virtual device which allow to flow data between different network. (Gateway is a IP Level Router)

If you want to communicate between two separate network, you have to have a gateway. As per i mentioned above line, it could be a physical or virtual device. what you need is route between two network.

Hope this will help

  • 3
    That's not quite true. Every IP device has a routing table. – Ron Trunk Mar 27 at 12:01
2

Is any device which satisfies the following two conditions already a gateway between two networks without being explicitly designated:

with two network interfaces connected to the networks respectively, and

with a routing table allowing packets to be transmitted from a network to the other (Is it correct that every device in network(s) has a routing table?)

The device also has to support forwarding of packets between networks and have that functionality enabled. Most general purpose operating systems (rather than devices specifically sold as routers) will not forward packets between networks by default.

  • Thanks. (1) Isn't my secon point about packet forwarding? (2) How can I know if my Linux enable or disable packet forwarding? – Tim Mar 27 at 22:55
  • The routing table determines where to send packets, (both locally generated and forwarded). But the system will only forward packets if it is configured to do so which is not the default "/proc/sys/net/ipv4/ip_forward" controls forwarding for ipv4, /proc/sys/net/ipv6/conf/all/forwarding controls forwarding for ipv6. – Peter Green Mar 28 at 2:38

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.