关于AWS中VPC下有一个资源叫做 Internet gateways , 也就是我们常说的IGW
关于IGW,我们可以参考官网文档 Amazon VPC / User Guide 中有如下说明:
An internet gateway is a horizontally scaled, redundant, and highly available VPC component that allows communication between your VPC and the internet.
It supports IPv4 and IPv6 traffic. It does not cause availability risks or bandwidth constraints on your network traffic.
An internet gateway enables resources in your public subnets (such as EC2 instances) to connect to the internet if the resource has a public IPv4 address or an IPv6 address.
Similarly, resources on the internet can initiate a connection to resources in your subnet using the public IPv4 address or IPv6 address.
For example, an internet gateway enables you to connect to an EC2 instance in AWS using your local computer.
An internet gateway provides a target in your VPC route tables for internet-routable traffic.
For communication using IPv4, the internet gateway also performs network address translation (NAT).
For communication using IPv6, NAT is not needed because IPv6 addresses are public. For more information, see IP addresses and NAT.
There's no additional charge for creating an internet gateway.
开启 Enable internet access 步骤
To enable access to or from the internet for instances in a subnet in a VPC using an internet gateway, you must do the following.
-
Create an internet gateway and attach it to your VPC.
-
Add a route to your subnet's route table that directs internet-bound traffic to the internet gateway.
-
Ensure that instances in your subnet have a public IPv4 address or an IPv6 address.
-
Ensure that your network access control lists and security group rules allow the desired internet traffic to flow to and from your instance.
1、其中对于IGW在页面上的创建也很简单,只需要输入一个Name的Tag值即可(必须项),但是后续也可以修改,如下图所示:
2、IGW创建了,但要让IGW启作用,还需要将IGW互联网网关 Attach 到 指定的VPC才可以的
3、对Subnet子网的路由表中,添加路由(一般是默认路由)到IGW,这样的Subnet子网,也被称为公有子网 / 公共子网
尊重别人的劳动成果 转载请务必注明出处:https://www.cnblogs.com/5201351/p/17434245.html
作者:一名卑微的IT民工
出处:https://www.cnblogs.com/5201351
本博客所有文章仅用于学习、研究和交流目的,欢迎非商业性质转载。
由于博主的水平不高,文章没有高度、深度和广度,只是凑字数,不足和错误之处在所难免,希望大家能够批评指出。
博主是利用读书、参考、引用、复制和粘贴等多种方式打造成自己的文章,请原谅博主成为一个卑微的IT民工!