I can't access Cloud9 on port 8081 running on Google cloud platform.
I am sure the application is running on that port and applications on the same machine on other ports (e.g. http://xxx.xxx.xxx.xxx:3000) are accessible correctly, so this doesn't seem to be an issue with the iptables settings.
I receive no response from the server http://xxx.xxx.xxx.xxx:8081/.
Google Cloud Platform configuration:
Allowed protocols and ports include tcp:8000-8089
IP Address set up as static and external
Command used to run Cloud9:
node server.js -w /home/workspace -l 0.0.0.0 -p 8081 -a username:password
The problem was that I have accidentally added some Target tags in the Google cloud firewall settings (Networking > Firewall rules).
Removing those tags solved my problem, I just use the default Apply to all targets setting.
Related
I opened all ports on Google cloud firewall but i still cant ping my server nor dns ports.
Any advice. I have used digital ocean in past but it was easy .Never managed to make it work in google cloud. They dont have even a free trial support..
By default there are some Firewall rules created for your project in the default VPC network, and one of these rules allows the ping from internal and external IPs.
But if you already delete them You can re-create the rule with the following command:
gcloud compute --project=<<PROJECT-ID>> firewall-rules create icmpnew --direction=INGRESS --priority=1000 --network=default --action=ALLOW --rules=icmp --source-ranges=0.0.0.0/0
To discard problems that could be in your premise network you can ping your instance from this site.
Additionally, If you have a Free trial account you can have chat support through Console Support Center, also, you can visit the following link for more information.
Edit1
You also can check the configuration from your OS, if you are using a Linux,If you want to allow it for everyone, try to specify the mask after the IP address.
from:
iptables -A INPUT -p icmp -s 0.0.0.0 -d 0.0.0.0 -j ACCEPT
to:
iptables -A INPUT -p icmp -s 0.0.0.0/0 -d 0.0.0.0/0 -j ACCEPT
Also you are using Windows, you can open the port or allow a protocol in a firewall with the following steps:
From the Start menu, click Control Panel, click System and Security, and then click Windows Firewall. Control Panel is not configured for 'Category' view, you only need to select Windows Firewall.
Click Advanced Settings.
Click Inbound Rules.
From the rules listed under Inbound Rules, select “File and printer Sharing (Echo Request – ICMPv4-In)” and enable the rule.
Click Finish.
Restart the Instance.
I hope this information would be useful to you
I am trying to run my flask app on GCP instance. However the app gets published at local host of that instance. I want to access that instances localhost.
I saw couple of videos and article but almost all were about deploying app on GCP. Is there no simple way to just forward whatever is published on localhost of VM instance to my PC browser and If I submit some information in the app then it goes to VM instance and gives back the result to my local machine's browser via VM instances localhost.
You can use Local Port Forwarding when you ssh into the target instance hosted in GCP.
Local port forwarding lets you connect from your local machine to another server. To use local port forwarding, you need to know your destination server, source port and target port.
You should already know your destination server. The target port must be the one on which your flask app is listening. The source port can be any port that is not in use on your local computer.
Assuming flask app is listening on port 8080 on the GCP instance and you want to make the app available in your local computer on port 9876, ssh into your GCP instance using the following command:
ssh -L 9876:127.0.0.1:8080 <username>#<gcpInstanceIP>
Same result can be achieved using gcloud compute ssh if you don't have the ssh key on the target instance.
The -- argument must be specified between gcloud specific args on the left and SSH_ARGS on the right:
gcloud compute ssh <gcp-instance-name> --zone=<instance-zone> -- -L <source-port>:localhost:<target-port>
You can also use the Google Cloud Shell:
Activate Cloud Shell located at the top-right corner in the GCP Web Interface
ssh into your instance with Local Port Forwarding
gcloud compute ssh <gcp-instance-name> --zone=<instance-zone> -- -L 8080:localhost:<target-port>
Click the Web Preview in the Google Cloud Shell, the Preview on port 8080.
I am trying to use Airflow for workflow management on my development machine on aws. I have multiple virtual environments setup and have installed airflow.
I am listening to port 8080 in my nginx conf as:
listen private.ip:8080;
I have allowed inbound connection to port 8080 on my AWS machine.
I am unable to access my airflow console as well as admin page from my public ip / website address.
You can just create a tunnel for viewing UI locally.
ssh -N -L 8080:ec2-machineip-compute-x.amazonaws.com:8080 YOUR_USERNAME_FOR_MACHINE#ec2-machineip-compute-x.amazonaws.com:8080
ssh -N -L 8080:ec2-machineip-compute-x.amazonaws.com:8080 YOUR_USERNAME_FOR_MACHINE#ec2-machineip-compute-x.amazonaws.com:8080
localhost:8080 for viewing airflow 8080 UI
Does anyone have an idea on steps of setting up an SSH tunnel for the CloudFoundry? I want to do remote debugging on cloud, but am blocked behind a firewall. So need to setup an SSH tunnel for that.
I wrote a blog post on setting up remote debugging for Java apps on Cloud Foundry. It covers using an SSH Tunnel to work around a firewall / NAT.
The answer from the article is this...
Obtain a public server.
Install SSHD. Edit /etc/ssh/sshd_config, add or set GatewayPorts to yes. Restart SSHD.
On your local machine run ssh -f -N -T -R 0.0.0.0:<public-port>:127.0.0.1:<debugger-port> <user>#<public-server-ip> (Windows users can use cygwin or possibly Putty, although the command will be different). This will instruct SSH to connect to the remote host, setup a reverse tunnel and go into the background. The reverse tunnel will listen on your public server on the port you specify (i.e. public-port) and forward traffic to the debugger port on your local machine. You can use different port numbers, but it is easiest if you just use the same port.
Start the debugger and listen on the same port (i.e. debugger-port) that you used in the SSH command.
Edit your manifest.yml file. Set JAVA_OPTS to -agentlib:jdwp=transport=dt_socket,address=<your-ip>:<your-port>.
Run cf push.
For a gentler walk through, see the post.
I have tried running Beego on AWS, but no matter what I have tried, I can't seem to connect to port 8080, which is where Beego is running on. I'm not sure if it's an AWS or a Beego issue, but I can't seem to connect to port 80 either (I have tried to change the security group setting, including adding a new one to allow access to both ports). However, when I curl 127.0.0.1, a Beego template is there, but there is nothing at my E2 instance. I changed the app.conf file's httpaddr to 0.0.0.0, but that didn't seem to do much. How can I approach this problem?
Check you conf/app.conf file:
httpaddr = localhost
By default, beego can be configured to listen to localhost only (as stated in this answer).
Other issues include (for the AWS part):
configuring security groups to permit inbound access on port 8080.
disabled any Application firewalls like Windows Firewall or Iptables for that port?
checking netstat -anp|grep 80 and sudo iptables -L
For ubuntu, the OP dtrinh100 mentions in the comments having to:
get it to work by disabling iptables, but since I'm running Ubuntu, it was a little different.
I used the iptables command from "How to start/stop iptables on Ubuntu?", which allowed me to turn off iptables in Ubuntu.