azurenetwork-programmingvirtual-machinehmail-server

Connecting two virtual machines in and azure virtual network


I am rather new to azure, and can't seem to be able to grasp some basic networking concepts. I want to open a mail server on one machine, and allow another machine to connect to it so that the two machines can use email over the virtual network. (Internal only, don't need to expose it to the internet).

My attempt: I created two virtual machines, put them in the same network group, resource group, and security group. I installed hmailserver on one machine (lets call it Machine A). I am able to connect to the mail server and send/receive mail fine from Machine A. Machine B can not see the mail server. The server runs on port 25 (SMTP) and port 143 (IMAP).

Machine A's IP is 10.0.0.4

If I run 'telnet 10.0.0.4 25' I get 'could not open connection to host...'

If I run ping 10.0.0.4 I get successful replies.

Both firewalls are completely off.

Through Azure I set the security rule for inbound and outbound to allow 'any' on both ports.

On the mail server settings I allowed connections from any IP.

I tried changing the server to run on ports 1025 and 1026 instead of 25 and 143 and reconfigured everything to see if those specific ports were blocked by azure.

I am stumped.


Solution

  • Finally found the problem after days of debugging. I'l post it here in case anyone else hits this issue:

    Of course it was a firewall issue (always the suspicion, as my host could connect to the ports, but my other machine could not). The firewall showed off on the firewall manager (and advanced firewall manager), so I didn't think that there were any issues. By a stroke of luck I found this command:

    netsh advfirewall set allprofiles state off
    

    Running this from the commandline on both the mail host and the connecting VM worked! There must have been some residual firewall going on even though windows was telling me that the firewall was all the way off... Thanks Windows. It's always fun to have a 3 day debug session to re-affirm my love for linux...

    Now on to figuring out how to enable the firewall without hiding my ports so I am not a sitting duck.

    Thanks to those who took the time to comment here.