Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to Open Nav Web Client on another machine within the Network #226

Closed
ashishsharmanav opened this issue Jun 29, 2018 · 17 comments
Closed

Comments

@ashishsharmanav
Copy link

ashishsharmanav commented Jun 29, 2018

I have a dedicated server with windows server 2016 where i have installed dockers. I have downloaded nav 2018 cu5 image and created container for the same. i have configured portainer to manage the containers within docker. Now the problem is i am able to browse to portainer and nav web client within the dedicated server, however when i am trying to browse the Nav web client outside the server but on a machine which is within the network i am unable to connect (through vs code) or even browse the page. Somehow portainer page has the configurations to be browsed from any machine within the network. Can anyone please help and let me know which step did i miss while creating container for nav web client?

@NAVspecialist
Copy link

There are several things you should test

  1. What is the IP-Address on the server vs the client. (Same IP-range?) - Can you ping the IP-address?
  2. Did you open the ports that NAV is using in the firewall
  3. do you try to connect using a ip-address or a DNS-name?

@freddydk
Copy link
Contributor

or maybe you didn't publish the ports from the container on the host.
-p 443:443 will redirect incoming traffic on port 443 on the host to 443 on the container.

@ashishsharmanav
Copy link
Author

@NAVspecialist - Thanks for the reply.

Yes i can ping the IP Address of the server.

I have added the Port 443 in inbound rules of firewall using ("netsh advfirewall firewall add rule name="Docker443" dir=in action=allow protocol=TCP localport=443 enable=yes profile=domain,private,public")

I am not using the IP address instead using the web client address which we get at the end after we use the New-Navcontainer command

@freddydk
Copy link
Contributor

It would help a lot if you specify the command you use to start the container?
The more info, the less questions we have to ask.

@ashishsharmanav
Copy link
Author

ashishsharmanav commented Jun 29, 2018

@freddydk - Thanks for the reply.

Don't really know what command i am supposed to use in this case.
I used :

New-NavContainer -containerName "TestNav2018CU4"
-imageName "microsoft/dynamics-nav:2018-cu4" -accept_eula
-auth NavUserPassword -licenseFile "C:\ProgramData\NavContainerHelper\NAV 2018.flf"
-IncludeCSide -updateHost
-useSSL -doNotExportObjectsToText
-enableSymbolLoading -alwaysPull
-includeTestToolkit

After this i didn't perform any other command for Port Enable

@freddydk
Copy link
Contributor

fine - this show me that your container indeed cannot be reached from outside the server unless you use transparent networking or other special things.
Normall you use NAT networking which means that you need to tell docker that you want this container to be accessible from the outside.
You need to publish the ports using f.ex. this:
$additionalParameters = @("--publish 8080:8080",
"--publish 443:443",
"--publish 7046-7049:7046-7049",
"--env publicFileSharePort=8080",
"--env PublicDnsName=$publicdnsName"
)
and then add -additionalParameters @additionalParameters to your new-navcontainer.
the Azure Rm template http://aka.ms/getnav is doing this and the script used to setup a container accessible from the outside with all bells and whistles is here:
https://github.com/Microsoft/nav-arm-templates/blob/master/SetupNavContainer.ps1
Good luck

@ashishsharmanav
Copy link
Author

@freddydk - Hi Freddy, used the following command, still i am not able to access from any other machine within the Network. Please let me know if i am missing out something in the command. I am using the URL - https://TestNav2018CU5/NAV/ to browse.

$publicdnsName = 'TestNav2018CU5'

$additionalParameters = @("--publish 8080:8080",
"--publish 443:443",
"--publish 7046-7049:7046-7049",
"--env publicFileSharePort=8080",
"--env PublicDnsName=$publicdnsName",
"--env RemovePasswordKeyFile=N"
)

New-NavContainer -containerName "TestNav2018CU5"
-imageName "microsoft/dynamics-nav:2018-cu5" -accept_eula
-auth NavUserPassword -licenseFile "C:\ProgramData\NavContainerHelper\NAV 2018.flf"
-IncludeCSide -updateHost
-useSSL -doNotExportObjectsToText
-enableSymbolLoading -alwaysPull
-additionalParameters $additionalParameters `
-includeTestToolkit

@NAVspecialist
Copy link

Did you try changing the https://TestNav2018CU5/NAV/ to the IP-address/NAV/ instead?

Can you start a commandprompt and type ping Testnav2018cu5 ?

@freddydk
Copy link
Contributor

Yeah, so what is the name of the Server on which the container is running?
The publicdnsname needs to be the name to use in order to reach that server - nobody outside your server will know about the containername.

@ashishsharmanav
Copy link
Author

ashishsharmanav commented Jun 29, 2018

@NAVspecialist - Running it with IP address, it worked on other machines. Thanks.
@freddydk - It worked, thanks.

Still not able to Download Symbols using VS Code from another machine.
"Error: An error occurred while sending the request.
The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.
The remote certificate is invalid according to the validation procedure."

I have installed the Certificate and added it in Trusted Root Certification Authorities, still getting the same error.

@ashishsharmanav
Copy link
Author

Hi Guys, Kindly Assist.

@freddydk
Copy link
Contributor

freddydk commented Jul 2, 2018

You are using a self-signed certificate. In the output of the container you will find the URL to this certificate (you can download it from the container). You need to trust this certificate on the computer on which you run VS Code. You do this by installing it on the trusted root certificatioins on that machine.

@ashishsharmanav
Copy link
Author

ashishsharmanav commented Jul 2, 2018

@freddydk - Still not working. I have downloaded the certificate from the container and Installed it on the machine. Still when i browse, i am getting the same warning of invalid certificate and when i am using VS Code to download symbol getting SSL error. Attached are the screenshots.

1
2
3
4
5

@freddydk
Copy link
Contributor

freddydk commented Jul 2, 2018

You cannot use the IP number for https - the name after https needs to be what the certificate is made for.
you can remove -usessl - then you will get a container running http.
If you need ssl - then you need to figure out how networking works in docker - this is complex and has nothing to do with the NAV docker image. It can be configures in a million ways to solve your needs.
Hint: You probably should be using transparent networking to allow the network to see your containers as individual computers.
Just using the IP number seldomly is a lasting solution.

@ashishsharmanav
Copy link
Author

ashishsharmanav commented Jul 2, 2018

@freddydk - Hi Freddy. Thanks for the Suggestion. created another container using following command, where i have removed usessl -
$publicdnsName = 'TestNav18CU5'
$additionalParameters = @("--publish 8080:8080",
"--publish 443:443",
"--publish 7046-7049:7046-7049",
"--env publicFileSharePort=8080",
"--env PublicDnsName=$publicdnsName",
"--env RemovePasswordKeyFile=N"
)
New-NavContainer -containerName "TestNav18CU5"
-imageName "microsoft/dynamics-nav:2018-cu5" -accept_eula
-auth NavUserPassword -licenseFile "C:\ProgramData\NavContainerHelper\NAV 2018.flf"
-IncludeCSide -updateHost
-doNotExportObjectsToText -enableSymbolLoading
-alwaysPull -additionalParameters $additionalParameters
-includeTestToolkit

Now the Problem is i am not able to browse my Web Client from another machine on the Network, however i was able to download symbols on the same machine via connection through the new web client URL (just the opposite of what was happening in the previous step). I am using "http://IP-address/NAV/" on the browser.

@freddydk
Copy link
Contributor

freddydk commented Jul 2, 2018

modify your --publish 443:443 (https) to --publish 80:80 (http) - else you won't publish the right port.

@ashishsharmanav
Copy link
Author

@freddydk - Worked, Thank you very much. 👍 🥇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants