简体   繁体   中英

Is it possible to hide ip of aws ec2 instance while requesting resources from server?

I've launched aws linux ec2 instance and I'm running node server over it. I'm requesting resource from server as follow

const data = await request ( 'https://www.example.com/data' ) ;

Is it possible to hide ip of my aws ec2 instance from example.com?

Please help me..!

If you want to connect to a host they must always have a source IP address from which the traffic originated from within the packet headers so it is not possible to hide a return IP address from the destination.

If your instance has a public IP address in a subnet with an internet gateway, then outbound traffic will be using the public IPv4 address of the instance.

If the instance can be made private then assuming it is communicating to a destination that is on the public internet it will use either a NAT Gateway or NAT instance for outbound communication. The destination will see the source here as the EIP of the NAT when it connects (not the instance).

Other approaches that could be taken are:

  • Forward all traffic in route table for route 0.0.0.0/0 (and ::/0 if IPv6) to another EC2 host or to an on-premise resource via VPN or Direct Connect. This would require the connecting appliance to support forwarding internet traffic.
  • Forward traffic to a proxy using network configuration on your host. You will be entirely responsible for setting this up and managing.

It would be helpful to expand a bit on what you mean with

Is it possible to hide ip of my aws ec2 instance from example.com?

If the IP address of the EC2 instance is mapped to a DNS name, then no. As soon as all the needed system services are up and running (considering any Linux type EC2 instance), the IP address will be mapped to the DNS name you defined. In this case, it would be example.com or any other DNS name that was defined for that particular IP address. This record type is called an A record (IPv4) or AAAA record (if you are using IPv6). You can read more about record types here .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM