From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to get ip address to one server when there are multiple network cards on the same computer

Thanks for your idea!

Actually the host only saves the route info to Gateway as below. The route info to server is saved in Gateway.

So this method seems not so reliable.

 

 

0 Kudos
Message 11 of 16
(873 Views)
Is that the output from route without without aa hostname on the command line? Sorry, posting from mobile due to the Thanksgiving holiday so I can't check on my own right now.
If that's with a hostname, I think your network is configured incorrectly. You should not have a default gateway for both network connections if only one of those gateways is actually capable of routing to the outside world. It's valid to configure a network connection without a gateway at all, in which case it willwill only route locally. If you do in fact need a gateway on the local-only connection, instead of being a default route, it should be configured with a netmask that limits where it can route.

You could also try the tracert (trace route) command but it can take a long time to finish.
0 Kudos
Message 12 of 16
(844 Views)

Thanks so much for your reply!

I set 0.0.0.0 as the destination address and the result is as the screenshot.

I'll check again and come back to update.

 

Thanks again and have a nice holiday!

0 Kudos
Message 13 of 16
(833 Views)
Why would you pick 0.0.0.0 as the destination? That address is never valid. It's often used when a network card has not yet been assigned an address (for example, while waiting for DHCP). Since that isn't a real destination, the routing for it is useless.
0 Kudos
Message 14 of 16
(821 Views)

If I use "route print + server address", there is no route info (active routes is none).

This means route info to the server address is saved in gateway, not the localhost.

So I use 0.0.0.0 as the destination address.

0 Kudos
Message 15 of 16
(789 Views)

Ah, you're right, sorry. As I mentioned I was away from the computer for the Thanksgiving holiday and couldn't test. You'll probably get the same result from simply "route print" without the IP address in that case. I'm not sure if that tells you anything useful, though, although you can use the "metric" to determine which gateway will be used preferentially. However I still think it's the case that if your network connection has a gateway that doesn't actually route to the outside world, then there should be no configured default gateway for that connection. If you do need to go through a gateway for some addresses, you can configure a route using the correct netmask to achieve that.

0 Kudos
Message 16 of 16
(773 Views)