
Implantei um servidor de aplicativos na instância de VM do Linux. O aplicativo está sendo executado com êxito e escutando na porta 3465. Abri a porta 3465 adicionando uma regra de firewall, mas ainda não consigo conectar o aplicativo da minha máquina Windows local na porta de escuta.
Usei a seguinte porta IP para conectar-me ao aplicativo de instância de VM da minha máquina local,
Endereço de IP:IP externo da instância de VM
Porta:3465
1) Adicionei uma 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) 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>
Observação: quando criei a regra de encaminhamento, o sistema usou automaticamente um endereço IP diferente do IP externo da instância de VM. então, novamente, a questão é se devo usar o endereço IP da regra de encaminhamento ou o IP externo da instância de VM?
Aqui está a configuração do 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