Antsle Forum

Welcome to our Antsle community! This forum is to connect all Antsle users to post experiences, make user-generated content available for the entire community and more. 

Please note: This forum is about discussing one specific issue at a time. No generalizations. No judgments. Please check the Forum Rules before posting. If you have specific questions about your Antsle and expect a response from our team directly, please continue to use the appropriate channels (email: [email protected]) so every inquiry is tracked. 

Forum breadcrumbs - You are here:ForumGeneral: GeneralChange port AntMan runs on?
Please or Register to create posts and topics.

Change port AntMan runs on?

I am playing with DMZ forwarding from my router to my first Nano.  I don't know if I will stick with this or not, I am going to start exploring port forwardiing from my router to my various Nanos.

So right now http://public-ip:80 will go straight to antman.   Is there a way to change antman to some other random port, and maybe hookup port:80 of my nano1 public IP directly into an antlet?

Like I said, maybe with my setup of several nanos living behind a single router, and port forwarding, it wont matter what port AntMan is on.

But I was thinking about getting some extra IP address from Comcast (the extra cost probably outweighs what I am saving on virtual machines with a cluster of nanos), but if I do that, then I would want to expose the nanos to the world to consume the additional IPs with no routers in front of them.  In which case, I definitely wouldn't want AntMan to be on all their port 80's.

 

OK. So this is a significant problem.

In my router I have forwarded:

When I go to   http://public-ip:1031  I get a login, which works, but I end up at http://public-ip  (because public port 80 DMZs to port 80 on the first nano1.local). I can browse antman. I can even add   :1031 to the url, and it still works and then stays on port 1031

When I try   http://public-ip:1032 I get a login prompt from nano2.   but as soon as I login, I am redirected to  http://public-ip which is the first nano. That is not where I want to be.

If the login page would not lose the port it was served on, this just might work.   Otherwise, apparently I need to be able to explicitly change the port of antman.

And will also need to set the port the web based console runs on, so each nano can be reached from port forwarding.  Right now the web based console runs on port 6880.

A workaround is to console into the first nano, then ssh into either of the two other nanos.

AntMan is listening on port 3000. I would try forwarding to the ip address:3000 of the Nanos.
Example: The IP addresses of the Nanos are 192.168.10, 11 and 12
publicIP:1031 forwards to 192.168.1.10:3000
publicIP:1032 forwards to 192.168.1.11:3000
publicIP:1033 forwards to 192.168.1.12:3000
We have seen a similar issue which may be in our nginx configuration and will look into it.
Btw, you could also use SSH to connect to antMan and is secure and does not require getting and setting up an SSL certificates.
Forward a port to port 22 of each Nano similar to what you have already done but for SSH.
Then use the -L option to tunnel other ports
    ssh -p 1031 [email protected] -L 9999:localhost:3000  -L 6900:localhost:6900 -L 6901:localhost:6901
Now, in your browser use http://localhost:9999 to open antMan
Ports 6900, 6901... are for the vncConsole for antlets.  The first KVM antlet started will use port 6900 the next 6901...
You could also add -L 6880:localhost:6880  for antMan > Console but you already have the terminal in the ssh session.
You might also be interested in setting up an SSL certificate for antMan:
https://docs.antsle.com/system/secure-https-access-to-antman#manual-https-to-antman

OK, so I setup 3 more port forwardings, each to port 3000 on each nano.

publicIP:3000 to nano1:3000 - login works fine.  - I end up at publicIP:3000 "nano1 | antMan". Click around look at some different screens, everything ok.

now I login on the second one publicIP:3001 -  I get logged in, briefly see nano2, but then both browser tabs log out!

I tried opening publicIP:3001 in an incognito window to nano2, and it opened, and nano1 didn't get logged out.

But trying to open publicIP:3002 got the login screen, but as soon as I open nano3, both nano2 and nano3 get logged out..  Apparently incognitio windows share cookies?

OK, so three different browsers, one for each nano.... OK....  Chrome regular, chrome incognito, and firefox, cool have them all three open at the same time with browser consoles to each one at the same time too.

So perhaps it is just the cookies that are getting in the way.

Pretty cool!  Thank you.