Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I know some of you may have CCNA / networking experience, so I hope that you can answer the following question for me.

How does an industry standard router handle local IP's, with two connected networks, with a single routing table?

I.e if a host on connected network 1 sends a packet with destination IP, what line in the routers routing table deals with this request, or is this all handled by the switches and host (arp) tables within the network. Does the router just ignore it?


share|improve this question
Either I misread or you are asking the wrong question. If "both networks were using a" address range as you write, then there would not be two networks but only one, thus nothing to route. – agporwfnz29 Apr 9 '12 at 20:41
Please don't cross-post questions on multiple Stack Exchange sites. Choose which site your question is most appropriate for, and ask it there. – nhinkle Apr 9 '12 at 20:52
up vote 1 down vote accepted

I remember the theory, you'd have a line for each subnet. and each port/interface of the router corresponds to a subnet. infact each port has an IP on its subnet.

the router has one routing table, with each row for each subnet. and each associated port/interface.

a row of the routing table might say (i.e. it includes and there's an interface and the interface may be called Eth0

Any packet sent to the router, whichever port it comes in on, if it has an IP on will end up going out on Eth0.

The router looks at the destination ip of the incoming packet sees it sees that is on subnet and looks through its routing table and sends it out Eth0.

Whether networks connected to the router are private IPs or public IPs is irrelevant.

A contrast between that router and a NAT Modem Router, is that the NAT Modem Router at home is like a 2 port machine, with a switch at the local side and you can't connect multiple local networks to it. Whereas a proper router has no switch in it and has more than 2 ports and you can configure subnets on the various ports.

If you read about Routing, I think you'd find that it only describes it like that, it make no distinctions as you do between industrial routers or not, local networks or not, there are no distinctions. And they all have one routing table. Not sure where you got the idea they'd have more than one. The only point i'd make though is that which is in the paragraph above, about some home routers having in built switches. But one tends not to read that in articles on Routing.

share|improve this answer
Thats great, thanks! – James Wilson Apr 9 '12 at 19:22

Paste your routing table if you want an exact answer. It's going to be the network number that's generated from applying the netmask to the destination IP. If there's no such entry, then it goes to the default.

share|improve this answer

I'm not an expert on this, but I think it's like this: The router is the gateway for the "host".

The router has two network interfaces/two IPs, one in each network, let's say (for network and (for network

The host machine has the IP address in the network The host has its own routing table, from which one is something like this "default" which makes any packet with an IP not resolved by its table to be ant through the router.

The router receives on the first interface ( the packet with the destination IP One line in the routing table is "" which means the packet which has the IP from network is sent to the network, to be resolved by who can resolve it.

Now, if there is a switch in the way, the switch has an physical addresses - IP addresses table (mac address table). If it finds any IP equal to the one of the packet it sends it to that physical address. If the receiver host is connected directly to the router, the IP is resolved by the the mac address table of the router.

  • FYI: ARP tables are used for resolving IPs from Host Names.

Hopefully, I'm not completely wrong. :)

Oh, and this router is a proper router. There are just more types of routers.

share|improve this answer

As per my knowledge when a Host of one network sends a packet to another networks host it will work like: 1-The switch connected to sending host will send the packet to the router as he will not find the destination in his table. 2-The router then send the packet to the second switch as he found that the receivers network is on that switch. 3-The second switch will forward the packet to the destination.

share|improve this answer

Note: If "both networks were using a," it's not two networks, it's a single class C network with a router inexplicably stuck in the middle.

Short answer: it depends on protocol and topology.

Imagine 256 hosts connecting wirelessly to one Internet-connected router: all packets, whether local or not, go through the router (since the wireless hosts are not connected directly to one another), and the router sends local packets to locally connected hosts and non-local packets out its default gateway to the Internet. On an Ethernet network, however, local traffic (meaning: hosts on the same bus) may be addressed with MAC addresses rather than IP addresses and may never even reach the router. Some packets may be handled by switches.

If you have two separate networks attached to a router, each network will have its own subnet and will be connected to a specific interface on the router. (You could not, for instance, have a host with on one interface, and another host connected to another interface with the same IP address.) Packets reaching this router will be looked up in the table and sent out the appropriate interface.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .