Proxy through multiple VMs
up vote
0
down vote
favorite
I have an API hosted on a Virtual Box on Azure VM.
The VM is only allowed to be accessible from another VM (specific IP) not on same VPC (it is EC2 VM). Still I cannot call the API from the EC2 VM, I need to proxy to make it done.
I want to be able to call the API from my local laptop by proxy through the EC2 VM and the Azure VM to get to the API in the Virtual Box.
Right now when I use the following command from within the EC2 VM to proxy to the Azure VM I am then able to call the API from EC2 VM
ssh -N -L .. etc
So now I am trying to also proxy through the EC2 to call the API but it is not working.
Lets assume
- API URL is : http://1.2.3.4:50100/api/
- Azure VM ip : 2.3.4.5
- EC2 VM ip : 3.4.5.6
What I am doing now :
In the Ec2 VM
ssh -N -L 3000:1.2.3.4:50100 -i <key> <user>2.3.4.5
This allows me to call the API from EC2 VM http://172.0.0.1:3000/api/
While the proxy is running in the EC2 VM I also run this command on my laptop
ssh -N -L 1240:172.0.0.1:3000 -i <key> <user>@3.4.5.6
My assumption that calling http://172.0.0.1:1240/api/
from my laptop will forward to the EC2 VM http://172.0.0.1:3000/api/
which in turn will forward to http://1.2.3.4:50100/api/
eventually.
What I am doing wrong here ?
proxy portforwarding
add a comment |
up vote
0
down vote
favorite
I have an API hosted on a Virtual Box on Azure VM.
The VM is only allowed to be accessible from another VM (specific IP) not on same VPC (it is EC2 VM). Still I cannot call the API from the EC2 VM, I need to proxy to make it done.
I want to be able to call the API from my local laptop by proxy through the EC2 VM and the Azure VM to get to the API in the Virtual Box.
Right now when I use the following command from within the EC2 VM to proxy to the Azure VM I am then able to call the API from EC2 VM
ssh -N -L .. etc
So now I am trying to also proxy through the EC2 to call the API but it is not working.
Lets assume
- API URL is : http://1.2.3.4:50100/api/
- Azure VM ip : 2.3.4.5
- EC2 VM ip : 3.4.5.6
What I am doing now :
In the Ec2 VM
ssh -N -L 3000:1.2.3.4:50100 -i <key> <user>2.3.4.5
This allows me to call the API from EC2 VM http://172.0.0.1:3000/api/
While the proxy is running in the EC2 VM I also run this command on my laptop
ssh -N -L 1240:172.0.0.1:3000 -i <key> <user>@3.4.5.6
My assumption that calling http://172.0.0.1:1240/api/
from my laptop will forward to the EC2 VM http://172.0.0.1:3000/api/
which in turn will forward to http://1.2.3.4:50100/api/
eventually.
What I am doing wrong here ?
proxy portforwarding
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have an API hosted on a Virtual Box on Azure VM.
The VM is only allowed to be accessible from another VM (specific IP) not on same VPC (it is EC2 VM). Still I cannot call the API from the EC2 VM, I need to proxy to make it done.
I want to be able to call the API from my local laptop by proxy through the EC2 VM and the Azure VM to get to the API in the Virtual Box.
Right now when I use the following command from within the EC2 VM to proxy to the Azure VM I am then able to call the API from EC2 VM
ssh -N -L .. etc
So now I am trying to also proxy through the EC2 to call the API but it is not working.
Lets assume
- API URL is : http://1.2.3.4:50100/api/
- Azure VM ip : 2.3.4.5
- EC2 VM ip : 3.4.5.6
What I am doing now :
In the Ec2 VM
ssh -N -L 3000:1.2.3.4:50100 -i <key> <user>2.3.4.5
This allows me to call the API from EC2 VM http://172.0.0.1:3000/api/
While the proxy is running in the EC2 VM I also run this command on my laptop
ssh -N -L 1240:172.0.0.1:3000 -i <key> <user>@3.4.5.6
My assumption that calling http://172.0.0.1:1240/api/
from my laptop will forward to the EC2 VM http://172.0.0.1:3000/api/
which in turn will forward to http://1.2.3.4:50100/api/
eventually.
What I am doing wrong here ?
proxy portforwarding
I have an API hosted on a Virtual Box on Azure VM.
The VM is only allowed to be accessible from another VM (specific IP) not on same VPC (it is EC2 VM). Still I cannot call the API from the EC2 VM, I need to proxy to make it done.
I want to be able to call the API from my local laptop by proxy through the EC2 VM and the Azure VM to get to the API in the Virtual Box.
Right now when I use the following command from within the EC2 VM to proxy to the Azure VM I am then able to call the API from EC2 VM
ssh -N -L .. etc
So now I am trying to also proxy through the EC2 to call the API but it is not working.
Lets assume
- API URL is : http://1.2.3.4:50100/api/
- Azure VM ip : 2.3.4.5
- EC2 VM ip : 3.4.5.6
What I am doing now :
In the Ec2 VM
ssh -N -L 3000:1.2.3.4:50100 -i <key> <user>2.3.4.5
This allows me to call the API from EC2 VM http://172.0.0.1:3000/api/
While the proxy is running in the EC2 VM I also run this command on my laptop
ssh -N -L 1240:172.0.0.1:3000 -i <key> <user>@3.4.5.6
My assumption that calling http://172.0.0.1:1240/api/
from my laptop will forward to the EC2 VM http://172.0.0.1:3000/api/
which in turn will forward to http://1.2.3.4:50100/api/
eventually.
What I am doing wrong here ?
proxy portforwarding
proxy portforwarding
asked Nov 7 at 8:57
Ahmad Alkhawaja
245923
245923
add a comment |
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53186187%2fproxy-through-multiple-vms%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown