0
votes

les

I created the instance from boot image. but always can not open port 7000 via firewall rules...and egress is (allow all), anybody knows where the problem is? System: Debian 10

ssh in terminal and

sudo natstat -plnt

Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 458/sshd
tcp6 0 0 :::22 :::* LISTEN 458/sshd

Is there any way to turn the port 7000 on ?

Encoutered the same issue when tring to open other ports like 5678...etc.

1

1 Answers

0
votes

First of all you need to set the GCP firewall rule as "ingress". Ingress is needed to allow incoming connections to the instance. Regarding the ports, it does not open or activate by itself or in automatic, you need to have a service listening on that port. However there are some tools used which allows you to activate the port by some time for testing purposes.

You can use tools like iperf3 to activate the port.

Install iperf3 for your vm with the command below.

sudo apt-get install iperf3

Once you have installed iperf3 you need to run the command below. ("-s" indicates your instance is in "server" mode, the "-p" is to set the port you prefer)

iperf -s -p 7000

On your remote machine (Client) you also need to install iperf3, if it is also a linux machine you can try the same command I mentioned earlier. Once you have installed iperf3 use the below comamnd to reach the VM pointing the port 7000. ("-c" indicates client mode,the "-p" is to set the port the server is listening).

iperf -c [server ip address] -p 7000

Please refer to iperf

Another useful tool is netcat