0

I have two units (a computer and a nas) connected to the same switch, both with external ips. Why are connections between them routed through the external gateway? Shouldn't the switch route them directly?

1
  • It's a bit annoying that I have gigabit on my network but since everything is routed via the ISP gateway it's wasted.
    – henrik
    Feb 28, 2011 at 9:51

2 Answers 2

4

What are the IP addresses and netmasks? Are both hosts in the same subnet? Are the machines dual-homed

A switch does not route, it forwards packets. If the IP of one of the client interfaces is on the same IP as the IP of the NAS interface that you used to connect, then it should not touch your router/gateway. If your devices have multiple addresses you could be using an address that is not common to both hosts forcing it to go through the router. If the 2 hosts are not on the same subnet then the traffic will have to go through the router.

6
  • Not dual-homed. The IPs are: pc x.x.103.233 nas x.x.102.69 gateway x.x.102.1 mask 255.255.254.0 (same gateway and mask on both)
    – henrik
    Feb 28, 2011 at 9:03
  • How do you know they are being routed? Can you post the logs/captures? If you ping the NAS from your client what MAC address shows up for the NAS IP in your ARP table. The MAC of the NAS, or your router.
    – Zoredache
    Feb 28, 2011 at 9:28
  • The nas and the gateway share the same mac in the arp table. And it's not my router. It's my isp's gateway if that makes a difference. more info in my reply to dbasnett. To be honest I don't KNOW how it's routed but the speed suggests it. That and a trace root.
    – henrik
    Feb 28, 2011 at 10:07
  • Ok the switch routes based on the MAC and the ISP gateway gives its own MAC. Is there any way to work around this? Setting fixed entries in the arp table? Not great but could it work?
    – henrik
    Feb 28, 2011 at 11:44
  • 1
    Looks like a static entry in the arp-table did the trick. While the nas retains it's ip at least.
    – henrik
    Mar 3, 2011 at 20:43
0

Assuming that the external gateway is a router and you have a setup like this

                 -------
--------         | S   |
|  PC  |---------| W   |     ---------
--------         | I   |    |         |
                 | T   |----|  Router |---> Internet
--------         | C   |    |         |
| NAS  |---------| H   |     ---------
--------         |     |
                 -------

the pc, nas, and router interface facing the switch will all need to be on the same subnet. When you say external IPs do you mean public IPs?

1
  • You assume correctly, or close enough, the router is a gateway belonging to my ISP. They are on the same subnet (look in my reply to Zoredache) and yes I mean that the IP's are public, supplied by the DHCP of my ISP.
    – henrik
    Feb 28, 2011 at 9:08

You must log in to answer this question.

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