-2

I have a Windows 2003 server which is connected to a router at 192.168.15.1 via 192.168.15.10. I also have a linux server connected to that same router via 192.168.15.90. And I have a direct connection between those two machines via 192.168.15.11 and 192.168.15.91 respectivly.

I'm trying to set up the network configuration so that it uses the direct connection by preference but if that's not working will automatically use the connection via the router instead.

I've set up static routes with different metrics for the connections but it doesn't seem to work if the direct connection is down.

Is what I'm trying to achieve actually possible simply with static routing or do I need to use dynamic/rip routing?

=======

I've changed the direct link to a different subnet 192.168.18.0/24, just in case there were conflicts there.

Without static routing PINg followed the path via the router so I added the following persistent routes on W2003:

C:\Documents and Settings\Administrator>route print

IPv4 Route Table
===========================================================================
Interface List
0x1 ........................... MS TCP Loopback interface
0x2 ...00 04 5a 7c 39 06 ...... Linksys LNE100TX Fast Ethernet Adapter(LNE100TX
v4) - Deterministic Network Enhancer Miniport
0x30003 ...00 13 20 5c ca 9b ...... Broadcom NetXtreme 5751 Gigabit Controller -
 Deterministic Network Enhancer Miniport
===========================================================================
===========================================================================
Active Routes:
Network Destination        Netmask          Gateway       Interface  Metric
          0.0.0.0          0.0.0.0     192.168.15.1    192.168.15.10     20
        127.0.0.0        255.0.0.0        127.0.0.1        127.0.0.1      1
     192.168.15.0    255.255.255.0    192.168.15.10    192.168.15.10     20
    192.168.15.10  255.255.255.255        127.0.0.1        127.0.0.1     20
    192.168.15.90  255.255.255.255    192.168.18.91    192.168.18.11      1
   192.168.15.255  255.255.255.255    192.168.15.10    192.168.15.10     20
     192.168.18.0    255.255.255.0    192.168.18.11    192.168.18.11     20
    192.168.18.11  255.255.255.255        127.0.0.1        127.0.0.1     20
    192.168.18.91  255.255.255.255    192.168.18.11    192.168.18.11      1
   192.168.18.255  255.255.255.255    192.168.18.11    192.168.18.11     20
        224.0.0.0        240.0.0.0    192.168.15.10    192.168.15.10     20
        224.0.0.0        240.0.0.0    192.168.18.11    192.168.18.11     20
  255.255.255.255  255.255.255.255    192.168.15.10    192.168.15.10      1
  255.255.255.255  255.255.255.255    192.168.18.11    192.168.18.11      1
Default Gateway:      192.168.15.1
===========================================================================
Persistent Routes:
  Network Address          Netmask  Gateway Address  Metric
    192.168.18.91  255.255.255.255    192.168.18.11       1
    192.168.15.90  255.255.255.255    192.168.18.91       1

And the following on Linux:

192.168.15.11/32 via 192.168.18.91 metric 1 dev eth1
192.168.15.10/32 via 192.168.18.11 metric 1 dev eth1

When the direct link is up, all is well, traffic flows as desired. When I take the link down though, although the persistent routes are removed from the active table, leaving me with:

IPv4 Route Table
===========================================================================
Interface List
0x1 ........................... MS TCP Loopback interface
0x2 ...00 04 5a 7c 39 06 ...... Linksys LNE100TX Fast Ethernet Adapter(LNE100TX
v4) - Deterministic Network Enhancer Miniport
===========================================================================
===========================================================================
Active Routes:
Network Destination        Netmask          Gateway       Interface  Metric
          0.0.0.0          0.0.0.0     192.168.15.1    192.168.15.10     20
        127.0.0.0        255.0.0.0        127.0.0.1        127.0.0.1      1
     192.168.15.0    255.255.255.0    192.168.15.10    192.168.15.10     20
    192.168.15.10  255.255.255.255        127.0.0.1        127.0.0.1     20
   192.168.15.255  255.255.255.255    192.168.15.10    192.168.15.10     20
        224.0.0.0        240.0.0.0    192.168.15.10    192.168.15.10     20
  255.255.255.255  255.255.255.255    192.168.15.10    192.168.15.10      1
Default Gateway:      192.168.15.1
===========================================================================
Persistent Routes:
  Network Address          Netmask  Gateway Address  Metric
    192.168.18.91  255.255.255.255    192.168.18.11       1
    192.168.15.90  255.255.255.255    192.168.18.91       1

PINGs from 15.10 to 15.90 fail (I see ARP messages who has 15.90 tell 15.10) and PINGs from 15.90 to 15.10 also fail with the response "from 18.91: host unavailable"

Ian
  • 101
  • 3
  • This sort of thing is why we prefer to hire people with CCNA certifications... now's a great time to [hit the books](http://www.amazon.com/Routing-Switching-200-120-Official-Simulator/dp/1587204665/). – Skyhawk Dec 08 '13 at 20:05
  • Routing is not the answer to the problem he's trying to solve. "How do I prevent loss of a NIC from taking my system down?" Answer : "NIC bonding or teaming." – mfinni Dec 08 '13 at 20:11
  • Ian, I see that the answer to a related question you posted on U&L also said "use NIC bonding." http://unix.stackexchange.com/questions/104277/how-to-detect-network-connection-failure – mfinni Dec 08 '13 at 23:02
  • Certainly does seem the best way to go. But I would like to retire the W2003 box at some stage and really wanted a quick hack not an expensive learning exercise. I got 90% of the way there with this, and if I had been able to reliably detect the link state on linux I could have done it just using static routing. Appreciate your help and comments nevertheless. – Ian Dec 09 '13 at 02:15
  • What problem are you actually trying to solve? You still haven't explained the big picture. – mfinni Dec 09 '13 at 13:45

1 Answers1

3

Where to begin ...

You have not told us the netmask - I assume these all on the same /24? If so, routing has absolutely nothing to do with this. These machines are all on the same subnet so there will be no routing.

I assume you have two NICs in each server? And I also assume you are trying to connect by IP? If so, the IP that is associated with the down connection is down and you can't contact it ever. If you disconnect the cable that links the .11 and .91 interfaces, those IP addresses are now unreachable.

If you're trying to connect by DNS names, is resolution happening properly?

To properly troubleshoot these things, you need to better-explain what you're actually doing, and it would really help you to understand the ISO model and troubleshoot up (or down) in sequence, so that you can zero in on where the problem is.

/edit - OK, I see your edit where you put the second interfaces on a different subnet. The point stands - if an interface (with an IP) is down, that IP is not reachable.

What are you trying to guard against? Sounds like "single NIC failure." Well, there's a standard measure to guard against that - NIC bonding. Make sure your NIC drivers support some form of it, team the NICs, and assign a single IP to the team (on each server.)

mfinni
  • 35,711
  • 3
  • 50
  • 86
  • Yes there are two NICs on each machine. The W2003 has NICs for 192.168.15.10 and .11, Linux has NICs for .90 and .91. The netmask for the .10 connection is /24. I'm unsure why you think I don't need static routes in here. How will the system know that .90 is available,and preferred, via .11 > .91 unless I tell it so? (Certainly it doesn't seem to know). I've been putting /32 netmasks on the routes for the direct link. I'm connecting just via numerics so I don't care about DNS names. – Ian Dec 07 '13 at 23:48
  • If you disconnect the direct cable, .11 and .91 are *DOWN*, and unreachable. You can't get to them anymore. – mfinni Dec 08 '13 at 14:38
  • Sure... But how does the system know there's a path to .90 down .11 and .91 unless I tell it? – Ian Dec 08 '13 at 17:35
  • There's no such path. You're doing something (or several things) very wrong. Don't have IPs in the same subnet with different subnet masks. – mfinni Dec 08 '13 at 19:49
  • Edited my answer to actually address what I'm guessing your real goal is. – mfinni Dec 08 '13 at 19:57
  • I updated the question text a while ago showing a change of the direct link from 15.0 to 18.0. Does this address your concern with subnet masks? The real goal is "How can I set up a direct link and have the indirect link used when the direct fails?" I have the direct link working as shown, but routing fails when the link is disabled, with the responses shown. – Ian Dec 08 '13 at 20:09
  • Read my edit. You're going about this the absolute wrong way. – mfinni Dec 08 '13 at 20:11
  • NIC bonding, iiuc, is NOT available in Windows 2003. Also I want to have one connection to the router, one direct, don't think this is how NIC bonding works is it? – Ian Dec 08 '13 at 20:17
  • 1
    It most certainly is, with the right NIC and driver. They do have to be terminated on the same device. This scenario that you're trying do is weird and non-standard. The only time that stuff like this is typically done is for heartbeat networks in clusters, which will be in unroutable networks, so the same type of traffic will not be sent over the regular LAN interface. You're so far off the map, without a complete explanation of what you're trying to do, all I can tell you is that you're probably doing it wrong. – mfinni Dec 08 '13 at 20:23