Eu implantei um servidor de aplicativos na instância de VM do Linux. Aplicativo está sendo executado com sucesso e escuta na porta 3465. Abri a porta 3465, adicionando a regra de firewall, mas ainda não é capaz de conectar o aplicativo da minha máquina windows local na porta de escuta.
Eu usei a seguinte porta IP para me conectar ao aplicativo de instância de VM da minha máquina local,
endereço IP: IP externo da instância da VM
Porto: 3465
1) Eu adicionei regra de firewall para abrir a porta
elon_musk@archway-146712:~$ gcloud compute firewall-rules list
NAME NETWORK DIRECTION PRIORITY ALLOW DENY
<firewall-rule> default INGRESS 1000 tcp:3465
2) Eu tentei adicionar regra de encaminhamento, mas não funcionou
elon_musk@archway-146712:~$ gcloud compute target-instances list
NAME ZONE INSTANCE NAT_POLICY
<ti-name> asia-south1-a <instance-name> NO_NAT
elon_musk@archway-146712:~$ gcloud compute forwarding-rules list
NAME REGION IP_ADDRESS IP_PROTOCOL TARGET
<fr-name> asia-south1 xx.xxx.148.135 TCP asia-south1-a/targetInstances/<ti-name>
Note: when I created forwarding rule, system automatically used IP address other than VM instance's external IP. so again question is whether I should use IP address of forwarding rule or VM instance's external IP?
Aqui está a configuração iptables da instância de VM do Linux
elon_musk@archway-146712:~$ sudo iptables -t filter -L -v
Chain INPUT (policy ACCEPT 2609 packets, 376K bytes)
pkts bytes target prot opt in out source destination
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
0 0 DOCKER-ISOLATION all -- any any anywhere anywhere
0 0 ACCEPT all -- any docker0 anywhere anywhere ctstate RELATED,ESTABLISHED
0 0 DOCKER all -- any docker0 anywhere anywhere
0 0 ACCEPT all -- docker0 !docker0 anywhere anywhere
0 0 ACCEPT all -- docker0 docker0 anywhere anywhere
Chain OUTPUT (policy ACCEPT 2433 packets, 237K bytes)
pkts bytes target prot opt in out source destination
Chain DOCKER (1 references)
pkts bytes target prot opt in out source destination
Chain DOCKER-ISOLATION (1 references)
pkts bytes target prot opt in out source destination
0 0 RETURN all -- any any anywhere anywhere