10-21-2016 12:32 PM
Hello
I have a SQL Server database located on a network with a subnet address in the range of 192.168.1.xxx and I want to access this database ,fetch some data and send it using UDP protocol to another network with address range of 10.181.37.xxx ,how can I direct my Database connection the the first network and at the same time direct my UDP connection to the second network ,provided that I have two network cards on the computer.
Also what other alternatives that I have ? I'm open to any suggestions.
10-21-2016 03:13 PM - edited 10-21-2016 03:14 PM
I think you are going to have to use the Route command via the Systemexec.vi to set the subnets to use certain interfaces
https://technet.microsoft.com/en-us/library/bb490991.aspx
Route
Displays and modifies the entries in the local IP routing table. Used without parameters, route displays help.
Syntax
route [-f] [-p] [Command [Destination] [mask Netmask] [Gateway] [metric Metric]] [if Interface]]
10-21-2016 03:53 PM - edited 10-21-2016 03:55 PM
Hmmm, at one place where I worked, I was hooked up to a couple of different networks with a network port for each. One was the company network and the other was a network that consisted of a UUT with its own private network. I was able to use my browser to access either one without having to do anything special. The UUT network did not support DHCP so that card was manually configured to a static IP address appropriate to the UUT network, but I don't think that had anthing to do with it.
I believe that as long as your NICs are properly configured - i.e., each of them has a valid IP address - the data "knows" where to go.
10-21-2016 04:12 PM
@billko wrote:Hmmm, at one place where I worked, I was hooked up to a couple of different networks with a network port for each. One was the company network and the other was a network that consisted of a UUT with its own private network. I was able to use my browser to access either one without having to do anything special. The UUT network did not support DHCP so that card was manually configured to a static IP address appropriate to the UUT network, but I don't think that had anthing to do with it.
I believe that as long as your NICs are properly configured - i.e., each of them has a valid IP address - the data "knows" where to go.
Actually you are probably right about not having to really do anything. As reading the TecNet article on Route it does say:
if Interface : Specifies the interface index for the interface over which the destination is reachable. For a list of interfaces and their corresponding interface indexes, use the display of the route print command. You can use either decimal or hexadecimal values for the interface index. For hexadecimal values, precede the hexadecimal number with 0x. When the if parameter is omitted, the interface is determined from the gateway address.
10-21-2016 05:31 PM
Interesting. You are working with two "private" LANs, and presumably do not have Internet access. If your two network cards are configured, one for the 192.168.x.x network, the other for the 10.x.x.x network, you should be good to go, as when you specify the IP address of your target, your PC will route it using the Network card that is configured for the address you specify.
Given that these are two separate networks that cannot talk to each other, two NICs seems to me the absolutely appropriate way to go (in my humble, possibly uninformed, opinion).
Bob Schor
10-21-2016 07:42 PM
@RTSLVU wrote:
@billko wrote:Hmmm, at one place where I worked, I was hooked up to a couple of different networks with a network port for each. One was the company network and the other was a network that consisted of a UUT with its own private network. I was able to use my browser to access either one without having to do anything special. The UUT network did not support DHCP so that card was manually configured to a static IP address appropriate to the UUT network, but I don't think that had anthing to do with it.
I believe that as long as your NICs are properly configured - i.e., each of them has a valid IP address - the data "knows" where to go.
Actually you are probably right about not having to really do anything. As reading the TecNet article on Route it does say:
if Interface : Specifies the interface index for the interface over which the destination is reachable. For a list of interfaces and their corresponding interface indexes, use the display of the route print command. You can use either decimal or hexadecimal values for the interface index. For hexadecimal values, precede the hexadecimal number with 0x. When the if parameter is omitted, the interface is determined from the gateway address.
I realized maybe my post seemed a bit snotty, but the "Hmmmm" was really me thinking to myself, not me putting you down. 🙂
10-22-2016 10:20 AM
If I understand correctly, NI things blast to every available NIC. With the correct one, it'll send and all will be well. With the incorrect, it'll have no route and die. Should appear to work without noticing the die.
10-22-2016 10:34 AM
@natasftw wrote:If I understand correctly, NI things blast to every available NIC. With the correct one, it'll send and all will be well. With the incorrect, it'll have no route and die. Should appear to work without noticing the die.
Maybe that's the way it works in a PC, period?
10-24-2016 09:15 AM
@billko wrote:
@natasftw wrote:If I understand correctly, NI things blast to every available NIC. With the correct one, it'll send and all will be well. With the incorrect, it'll have no route and die. Should appear to work without noticing the die.
Maybe that's the way it works in a PC, period?
That is not the way it works at all.
See the route command I posted the link to earlier.
With two NIC configured the route (What NIC will be used) is figured out by the configuration of that NIC (IP Subnet, GATEWAY, etc). It's not just blasted out to every NIC.
To be sure you should set a persistent route.
10-24-2016 09:50 AM
I found this KnowledgeBase Article that seems to indicate that you can manually distinguish the two NICs by using TCP Listen.vi with TCP Create Listener.vi or you can simply use TCP Open.vi and let Windows worry about which card to use.
I guess you can do it both ways.