Let's consider this for a moment --
hostA --> NICA (subnet A), NICB (subnet B)
hostB --> NICA(suibnet A), NICB (subnet B)
you want hostA(NICA) to connect to hostB(NICB) (when trying to connect to hostB) even though hostA(NICB) is in the same subnet as hostB(NICB)?
Or have I misunderstood your requirement?
> Nico,
>
> I know how to configure IPMP. What I have is 2
> interfaces connected to 2 different networks, and
> when I use ping or telnet, I want to connect to
> devices on the first network card by default without
> having to specify using this interface specifically.
what OS? Solaris 10 has additional commands that allow you to specify a particular address as the default for outbound connections (the question doesn't really make sense for inbound).
I don't know any real easy way to do so in previous versions.
--
Darren
> I want to connect to devices on the first network card by default
> without having to specify using this interface specifically.
How is this not a default route?
The only exception being the fact that you simply cannot force the OS to take the long way around of the system you're trying to reach is connected to the subnet of the second interface.
For example:
You're on host A and you're trying to reach host B...
[ host B ] router 3 router 2 router 1 subnet 1 NIC 1 [ host A ] NIC2 subnet 2 [ host B ]
I don't think there's -any- way of telling the OS to take the route through NIC1 to reach hosts in subnet 2, without actively disabling the route for NIC2.
Now I'm actually getting curious why you would want to do such a thing?
Message was edited by:
Cailin_Coilleach
> > I want to connect to devices on the first network
> card by default
> > without having to specify using this interface
> specifically.
> How is this not a default route?
I read his question as asking about what address/interface that outbound TCP connections will use by default. Of course I may be misinterpreting.
--
Darren
You are not misinterpreting, this is what I want.
> > > I want to connect to devices on the first
> network
> > card by default
> > > without having to specify using this interface
> > specifically.
> > How is this not a default route?
>
> I read his question as asking about what
> address/interface that outbound TCP connections will
> use by default. Of course I may be misinterpreting.
>
> --
> Darren
> How does Solaris know that he should use NIC B to reach HostB (NIC B)
> if his default or primary NIC is NIC A?
Basic routing? Solaris will figure out the shortest way to a destination. If the shortest route is through one of its other interfaces which -doesn't- lead through the default gateway, then it will still take the shortest route.
> More than this, how does solaris know which is his default or primary interface?
I am not sure if there is such a distinction within Solaris.
> I want hostA (Nic B) to connect to host B(NicB). How
> does Solaris know that he should use NIC B to reach
> HostB (NIC B) if his default or primary NIC is NIC
> A?
Can you provide a configuration of your host? (ifconfig -a and netstat -nr output?)
> More than this, how does solaris know which is his
> default or primary interface?
Generally there's no such thing. Placing 2 interfaces on the same subnet without using IPMP isn't supported. So if the interfaces are on different subnets, then the routing table usually distinguishes between each. If you use IPMP, then both interfaces are used for aggregate connections.
--
Darren
[[[Generally there's no such thing. Placing 2 interfaces on the same subnet without using IPMP isn't supported]]]
Why not? I must admit I haven't tried it (never had to), but still..I'm curious.
It's interesting, that there isn't any source affinity built into the Datalink layer in Solaris/Sun drivers. Diagnostic commands can be told to use a particular NIC to run the diagnostics (like ping and traceroute). I have a feeling he's (original poster) is asking it for Load balancing needs -- in which case there would have to be special/specialized software to do the needful...I think.
[[[t's interesting, that there isn't any source affinity built into the Datalink layer in Solaris/Sun drivers. Diagnostic commands can be told to use a particular NIC to run the diagnostics (like ping and traceroute).]]]
To add to this -- by definition, IP datagrams should be tied to physical MAC (unless they've gone and changed the RFCs on me again :)) -- so source affinity should be built in (unless local-mac-address? is set to false)
> [[[Generally there's no such thing. Placing 2
> interfaces on the same subnet without using IPMP
> isn't supported]]]
> Why not? I must admit I haven't tried it (never had
> to), but still..I'm curious.
Because in that configuration the routing table will pick one of the interfaces as the route to the subnet. So you have no redundancy.
If the link goes down, neither the IP binding nor the routing table will see that. It still tries to push the data out the interface and you lose your connectivity.
So you can set things up that way, but it probably won't do what you expect.
IPMP monitors traffic on the link, so it's the supported way to do this.
> It's interesting, that there isn't any source
> affinity built into the Datalink layer in Solaris/Sun
> drivers. Diagnostic commands can be told to use a
> particular NIC to run the diagnostics (like ping and
> traceroute). I have a feeling he's (original poster)
> is asking it for Load balancing needs -- in which
> case there would have to be special/specialized
> software to do the needful...I think.
IPMP will do a type of load balancing on outbound data. In addition, it monitors connectivity and can handle failures of a link.
--
Darren
> To add to this -- by definition, IP datagrams should
> be tied to physical MAC (unless they've gone and
> changed the RFCs on me again :)) -- so source
> affinity should be built in (unless
> local-mac-address? is set to false)
I don't follow. Why are IP datagrams tied to a physical MAC?
On my machine, I have subnet A and subnet B attached to separate interfaces. If I send a packet with source IP: S and destination IP A.x, then I expect it to go out the interface on subnet A and use that MAC for source ether.
If I send a packet with the same source IP, but with destination IP B.x, then I expect it to use the other interface and have a separate mac address for the source.
Did I misunderstand what you meant?
--
Darren
[[[I don't follow. Why are IP datagrams tied to a physical MAC?]]]
Corrections -- the mac address get's put in later (at the datalink layer). The ARP/RARP protocol helps resolve IP to MAC (and vice versa).
And I see what you mean about two interfaces being on the same vlan/subnet not supported. It would probably be detrimental (more than anything else) to route add the second IP/NIC into the routing table.
Message was edited by:
implicate_order
> And I see what you mean about two interfaces being on
> the same vlan/subnet not supported. It would probably
> be detrimental (more than anything else) to route add
> the second IP/NIC into the routing table.
They are both in the routing table (added when the interface is brought UP by ifconfig). It's just that they have identical weights (both are directly connected), so a packet has no reason to prefer one over the other.
One of them will be selected for all traffic rather than both used in some sort of round-robin.
--
Darren
Solaris uses a Routing Table. To check your setup type:
# netstat -nr
Routing Table: IPv4
DestinationGatewayFlags RefUseInterface
-- -- -- --
192.168.4.0 172.31.254.1 UG170
172.31.254.0 172.31.254.10U 1393 ce0
224.0.0.0172.31.254.10U 10 ce0
default 172.31.254.2 UG11144
127.0.0.1127.0.0.1UH501916430 lo0
Your default route will be listed under the Destination column, in this case 'default'. So the default route will use the Gateway 172.31.254.2 in this example. You will also notice there is another defined route to another network. The first entry defines a network. So to get to anything on the 192.168.4.xxx network, Solaris will use the gateway 172.31.254.1.
This also applies to other NICs on the system. You will need to define a route for them so Solaris knows which interface to use for a given network or node.
To setup these routes you use the "route add" command. Ex:
route add -net 192.168.4 172.31.254.1
route add default 172.31.254.2
However, prior to running the route add command, you should check and see how your installation setup the routes by using the "netstat" command.
Hope this helps.