Will windows know if network path is local or not - windows

Let's say I have a shared folder on my machine, for example : \MyMachine\foo.
If I try to access it on the "MyMachine" computer, will it be smart enough to know that it is on the same machine and won't try to use the network adapter and be super slow? I tested it by disabling my network adapter and it was still working, but it might have been because I disabled it that it checked locally instead of using the network adapter.
My concern for not wanting to use the network adapter is speed. Large amount of data needs to be acceded sometime by network path if used outside, but if it is getting acceded locally it has to be quickly.

Every UNC is resolved down to it's core protocol address. Assuming a standard network of TCP/IP, your UNC will be resolved to local machine and the IP will be the same as your loopback IP. The network adapter won't be needed in this case so nothing will be sent over the network. In short, communication will be via the loopback address which does not require network.
Extracted from:
https://serverfault.com/questions/411389/does-traffic-from-accessing-locally-shared-file-via-unc-path-still-go-through-th

It wont, because the changes are taking place in your computer.
However if someone else is trying to access that directory then your computer must send the directory's information to the other computer, thus using the network.

Related

Can you have a single domain across 2 servers within Hyper-V Manager?

I am running a Hyper-V lab for a client to test the functionality of a Powershell script and due to memory constraints, I would like to move my file and database VM servers off of my main desktop PC to my laptop. I set up Hyper-V on the laptop, and successfully exported/imported the VM's into the other Hyper-V server. I can boot them, all the configuration and files are intact however, I am predictably having trouble reconnecting to the domain they were a part of prior to the move. I understand I need an External virtual switch to handle that communication, as internal and private will not reach outside of the Hyper-V server they reside in. Obviously I would prefer to not use an external, but this is strictly to continue testing. I've trouble-shooted entering different DNS server values from the client machine's IPv4 properties and changing the virtual switch to External for the existing Hyper-V server, and re-register the DNS records on the DC. All result in the same error when I try to connect to the domain: "(error code 0x0000232B RCODE_NAME_ERROR) The query was for the SRV record for _ldap._tcp.dc."... "The DNS SRV records required to locate a AD DC for the domain are not registered in DNS".
In summary, I want to move a VM from the first server listed to the second, and then re-connect to the domain they were part of previously. Both machines are just running Windows 10, not Windows Servers, if that matters. Another note, I can do remote sessions from the desktop to the laptop just fine which would lead to believe this is not related to a firewall. Thanks!
The best it to set up a VLAN. If you can't do that, change the network class of your AD lab machine (192.168.55.x ?) to another in order to avoid conflicts.
Your DNS server has to be AD to make your machines connecting to it.
And last but not least, if you're on 2 different hyperV servers, you have to use external switch in hyperV:
https://redmondmag.com/articles/2018/05/04/hyper-v-private-networks.aspx

Hyper-V - No Guest Internet

I'm using a Windows Server 2019 server from Microsoft Azure. I have installed Hyper-V with the management tools and am now trying to setup a Ubuntu 14.04LTS VM inside of Hyper-V. I create a new External Switch however when setting up the Ubuntu instance there it tells me that there is an issue with the DHCP server. When I check my network connections for the newly created switch there is IPV4 connectivity, with packets being sent and received.
Things that I have tried:
-Ensured that inside of the Virtual Switch Manager that in my newly created virtual switch, the external network is selected as my main internet adapter. And that the "Allow management os to share this network adapter".
-Tried selecting "Internal Network"
-Inside of the ubuntu server, tried dchlient -r and dhclient eth0 to try to retrieve a new IP (For internal network this has worked, but without internet access, for external ip it hangs on the command dhclient eth0)
-In Network Connections I have tried bridging the two connections (out of desperation, "bricks" the vps causing me to not be able to rdp, must create a new azure vm)
-I have tried right clicking the main "ethernet" inside the Network Connections and allowing sharing options to other users.
Please help as I'm quite lost as to why the Ubuntu Guest is not connecting to the internet with the new network switch
The virtual switch connection types are very confusingly named, and sharing is somewhat flaky. I've had best results with the Internal Network. Most of the time it just works but there are certain situations when the NAT service breaks and you will have to restart some combination of the host and guest machines, possibly both -- I've not found a way to just restart the virtual switch service without restarting the host OS.
If you need to use the External Network type, be aware that your actual physical router will be in the mix, so you must make sure that it is properly configured, especially if you're doing MAC filtering on your router and the guest is not using the hardware MAC. This usually happens because of the virtualisation process itself, even if it's not something you've configured in the guest.

Accessing my Local Host from different computer in a different network

I'm current using Xammp,and have created a website in the htdocs. I want to know if i can access this from another computer (not in the same network) and work on the site from that other computer.
You can do this by using the dynamic dns service provided by noip.com. Download the noip client and setup an account in it (try Googling on it).
After that you must edit the conf files in XAMPP to allow outside network to communicate with your network.

USB sync of local database to WP7

I have a requirement where data on SQL server needs to be synced to WP7 devices through USB.
I initially thought of writing a WCF Lib., but it'll go online & sync even if device is connected to USB in local network (Where it's easy & cheaper to get data over local network rather than go to internet & get it).
I have coded isolated storage to save the data synced, but i need an efficient way of getting data from local network, while it's connected to local network.
My questions are:
Is there a way to request data from local network when connected to local network in WCF?
Does someone have a C# code i can use to write synchronization routines to usb over local network? (I would love to have the code, if anyone has this)
Is there a better way of achieving what I'm trying to do?
I'm hoping for some quick answers for this problem, any help is greatly appreciated.
Thanks.
My recommendation would be for your WCF API to have an DNS name pointing to an internal IP address, which is not available outside of the local network and in the routing it will get resolved through USB and another DNS name pointing to an external IP Address which is only available outside of the local network. Your application would try to connect using the local IP address first, which should go through the local network and if it fails it should retry the with external option.
You can use NetworkInterface.NetworkInterfaceType to detect a connection of type Ethernet.
Implementing a full sync protocol is complicated and not something I would recommend attempting unless you really have to.
If you do go down this route I'd recommend using item based message queues and then syncing the queues (and replaying as necessary) rather than trying to sync database tables. It'll depend on the requirements of your application and nature of the data though.
Further to both Murven and Matt's answers, I'd recommend looking into the Microsoft Sync Framework, which supports WP7 as a client, commonly uses WCF on the server, and has great support for a wide range of edge cases.
You can then, as per Matt's answer, watch for connectivity changes and, on USB connection, start a sync to a local IP.
When it comes to targeting mango, you can implement it as a ResourceIntensiveTask and it will run when USB is connected, even if the app isn't running.

How to quickly connect 2 PC together using Ethernet without router / DNS

In the field I often need to perform remote debugging on a target PC using my Delphi development IDE running on my (host) laptop. Because I cannot use any pre-existing network address infrastructure I use a cross-over network cable directly linking the two PC's. I then setup manual IP address of (say) 100.100.100.1 and 100.100.100.2 for the two and after much rebooting and fiddling I get the shared folders that I need. Finally after working in this way I have to carefully put things back to how they were.
This is pain though. There is a lot of typing and room for error. Further, sharing can take a while before things become visible. Is there some way that I can run something (or write a script) that would ease this process in any way?
Use the designated intranet IP ranges: 10.x.x.x or 192.168.x.x, not 100.x.x.x.
Run a DHCP server on your box. The other box will most probably be already configured to use DHCP to obtain an IP address, this is the default. Windows comes with a bundled DHCP server (at least some versions, install it as a Windows component), or you can use a third-party one.
You need zero rebooting on either box: all modern OSes allow to change IP addresses and routing on the fly, Windows is capable of this for at least a decade. Note that you don't need to change the IP address of your box. Often the secret of fast folder access is using the IP address, like \\192.168.1.1\share_name because name resolution services may take long time to kick in.
If you want both the link via the cross cable and a wired Internet/LAN link, just add another network card to your box (slightly more expensive with notebooks) and have the DHCP server only work with that dedicated card, so you don't need to touch the Internet-connected interface at all.

Resources