Cross module direct communication (via IP / sockets) - azure-iot-hub

If we have two custom modules that need to communicate directly via sockets, is there a way to know what the IP address assigned to each module?
After reading this article I was under the impression the azure-iot-edge network bridge would possibly support referencing the running module by the module name as the hostname. This doesn't seem to work.
I guess we are trying to avoid having to scan the network or use some local storage option and don't want to join the host network so any ideas how one module that is running can find the IP of another module that is expected to be running?
Here is a picture showing the two containers I am testing with. The one container is just an alpine instance that I can attach the console to and use to try to ping / access other containers. I can ping by IP address but want to ping by container name instead.

After further study of this issue, it turns out the issue was the arm32v7 arm image I was using when deployed had some issues. One of the oddities was that the date on the container was "Sun Jan 0 00:100:4174038 1900" and there were some other commands failing that should have worked.
I ended up switching over to an ubuntu image with iputils-ping installed and confirmed that the azuire-iot-edge bridge allows accessing other containers by their module name which servers as the host name, so all good here, works as expected, user error!

Related

Connecting through VNC to an Shared Image from another Google Cloud Project

I am recently working on a project in Google Cloud Compute Engine, and I have created an image of my current work. In this instance I can access using VNC Viewer to a GUI like of the instance by using the public IP and the port :5901 .
I gave the permissions to another person to use this image in his own proyect, but although he can start the instance created from my image, he cant access using VNC and the public IP (timeout problem).
I guess it has to do with anything related to the SSH protocol, but I dont know exactly how.
Does anyone has an idea of how to solve this issue?
I found the asnwer in a youtube video: Here, (10:52) I just had to habilitate the tcp ports on my project. Thanks!
I had to go to firewall configuration, add firewall a rule that habilitates all tcp ports from 0.0.0.0/0 for incoming connections in all instances since I'll be using more than one instance in my project.
Honestly I don't know if I did "overdo" anything, but it worked for me.

Change the "IP Address" portion of a local Apache2 server to some consistent string

I have an Apache2 server running in Debian 9.
I am using it to host a custom MediaWiki Wiki.
To navigate to the Wiki I use something of this form "10.200.200.20/mediawiki" where the Apache2 server is running on 10.200.200.20.
This works fine however sometimes the IP Address (10.200.200.20) will change and then everyone on the local network navigating to the Wiki will have to be notified and use the new IP Address which is a hassle.
I wish to change it to something consistent, for example "OurWikiServer/mediawiki" it doesn't really matter that much as long as it can always be found at the same place.
I know this is possible as the MediaWiki installation was previously maintained by someone else who used XAMPP in Windows 7 and it was configured to be found at "stringHere/mediawiki" on the local network.
I have tried changing it in /etc/hosts and can get it changing on individual machines as expected, however have no idea how to get it working network wide.
The best way to do this is to define the IP of this station static. This can be done via reservation in DHCP server or assign IP outside of the DHCP IPs. Also consider adding small DNS server to provide hostname instead of IP

Setting up ubuntu VM on Azure with apache

In Azure, I created a virtual network and then associated an Ubuntu Server virtual machine, created with Azure Resource Manager Deployment method, with the network. I then updated the associated Network Security Group and added an inbound security rule for port 80 (Source:Any, Destination:Any, Service:TCP/80). After installing Apache on the VM, I tried to access the server from my browser, but have run into a wall. I can SSH into the VM just fine, but web is a no-go, and I cannot figure out why. Any help would be appreciated.
It sometimes happen to me too because I forgot to RESTART the VM, yes just restart it. At least this works for me. and also dont forget to add outbound rule too
It worked for me with this inbound rule.
Note that when a VM is created from the portal (in ARM model), it gets automatically associated to a virtual network (vnet), a specific subnet within the vnet and a network security group.
When creating the inbound security rule, make sure to:
identify the correct network security group associated to the VM
use a priority number lower than 65500
set the source port range as *
You also need open port 80 on the VM to allow web access.
I dont think that creating your Network Security Group opens the desired port on the VM automatically.
By default in Azure Resource Manager (ARM), all ports are open; there is no need to make Network Security Groups (NSGs) to open ports, only to close them. Here is an example of an ARM template that deploys an ubuntu VM with apache:
https://github.com/Azure/azure-quickstart-templates/tree/master/apache2-on-ubuntu-vm
Alternatively, if you want an auto-scaling LAP stack using VM Scale Sets (in public preview), you can find the ARM template for that here:
https://github.com/Azure/azure-quickstart-templates/tree/master/201-vmss-lapstack-autoscale
Hope this helps! :)

Microsoft Azure Apache Web Server Not Accessible

I've created literally dozens and dozens of web servers in my day, but this is my first attempt with Windows Azure and I'm running into some problems. I just started migrating from AWS recently.
First of all, I'm running Ubuntu 13.04. Firewall disabled (for debugging), Apache2 installed correctly (using apt). SSH works fine as do many other services with both the DNS hostname and public IP. Virtual host is set up correctly and validated. However, I cannot access the HTTP website either through the Azure provided subdomain or the virtual IP. It just times out.
This is also my first time using Ubuntu 13.04 as well. So, through the powers of deduction, I'm assuming there is something I'm missing either with this new version of Ubuntu or some quirk in Azure. Does anyone have any suggestions?
SOLUTION
These steps to create "endpoint" works fine for all VPS:
open "virtual machine > endpoint > add endpoint"
choose "next"
set "name:http, protocol:tcp, public port:80, private port:80"
choose "complete"
and then must wait for activation and then for some time.
If you are using Azure Resource Groups along with your VMs (which is available on the new portal) you cannot use endpoints because it's not available there, so you should follow the following to open up the HTTP port or ANY other port:
1- Select the VM that you want to manage ports on.
2- In settings, click on Network Interfaces and select your network.
3- Go to Network Security Group and select your group.
4- Add Inbound or Outbound security rules depending on what you need.

Windows - VBScript - Determine IP address of computer on network

I have written some VBScripts to automate tasks that I perform on computers over the network. These work great for most tasks however within our network we have problems with the IP address in DNS being correct all the time. This mainly occurs with laptops where we have different IP ranges for machines on the wireless and wired network.
For example a machine may boot up wired in the morning and get an IP address: 10.10.10.1
When it switches to wireless it will obtain an address in a different subnet: 10.11.10.1
When you try to connect to that machine it still returns the old IP address (10.10.10.1) even though the computer now has a new one.
I have found that I can still connect to that computer's C$ share via \computer name\c$ even though the machine does not ping. Obviously there is some other kind of address resolution going on, my question is how do I harness this to allow my VBScripts connect to WMI?
Thanks!
If DNS doesn't have the correct address, then perhaps it is likely being resolved with NetBios. What you would have to do is resolve the computer name with either a WINS Server or through Broadcasts to the network. Depending on your network environment you would use one or both of those options.
Microsoft has a tool called NBLookup which should be able to lookup the name from WINS at the very least.
You can call NBLookup and parse the results. I don't recall another method for NetBios resolution natively within VBScript, but I haven't looked awfully hard recently.
Your problem is name resolution. Windows uses 2 types of name resolution: DNS and NetBIOS.
DNS will resolve a name like .comcast.net or www.google.com
NetBIOS resolves names that are 15 characters or less, like your computer name likely is.
When your computer looks for a name it doesn't know how to turn into an IP address, it goes to a DNS server and/or uses NetBIOS name resolution. Once it's looked up a name, it saves it in a cache for some period of time (usually about an hour) before looking it up again.
You can look at the list of names your computer has cached for each type of name resolution using the command-line this way:
DNS
ipconfig -displaydns
NetBIOS
nbtstat -c
Each of those commands also alllows you clear that cache as well, which will force your system to rediscover what IP address the name points to. Here are those commands:
DNS
ipconfig -flushdns
NetBIOS
nbtstat -R
Between those commands, you should be able to determine which type of name resolution is the culprit and resolve it by flushing that cache.
From my own experience I have found the Microsoft TechNet ScriptCenter has just about anything you could ever want relating to VBScript. That's generally where I start when I want to delve into a new area of VBScript that I haven't previously explored.
The WMI FAQ on the Microsoft TechNet website has links to the ScripCenter along with links to many other usefule sites for learning how to script WMI. I would recommend finding a script that already does what you want since someone is bound to have already written what you need.
The article Automating TCP/IP Networking on Clients may have what you need to get started with resolving this problem.