What is Destination and Target in Route table? I can see Destination and target can be configured to Internet gateway, is there any other use case ?
What is Destination and Target in Route table? I can see Destination and target can be configured to Internet gateway, is there any other use case ?
Destination => IP address/CIDR range .
Target => Where you want to send the traffic for the specified destination (e.g. if the destination is my local subnet, mention target as "local")
The Internet gateway is one of the targets (e.g. routing traffic to the internet). Other options for the target would be
Route table document explains it well.
Each route has a destination and target field.
local (i.e. to targets in this VPC) or your-internet-gateway-ID in case those requests should be routed to the gateway for external/somewhere-else access. A list of possible target values is here.Here's an example assuming a VPC with addresses 10.0.0.0/16
| Destination | Target |
|:------------|------------:|
| 10.0.0.0/16 | local |
| 0.0.0.0/0 | your-igw-id |
This will route any request with into-the-VPC destination to local targets in the VPC. If the pattern 10.0.0.0/16 is not met, the any-ipv4-address aka 0.0.0.0/0 will be considered and the request will be routed to the internet gateway you specified with ID your-igw-id.
The order of the routes is irrelevant since the most specific route will be chosen.
A short answer:
Destination: the packet's final destination
Target: where the packet should go next, to get it one step closer to the intended destination.
e.g.
You are planning a business trip from the US to Paris.
This is easy to comprehend, for any entry in a Route Table there are the following 2 parts:
Example: Destination: 0.0.0.0 and Target: Internet Gateway - Here all traffic will be passed on to the Internet Gateway
This is how I understand?
destination : Final target or Goal
target : Immediate target to achieve final target(via)
Ex:
destination can be Orthopedic Doctor
target can be MBBS, which a College student can take(via) to reach his final target or destination i.e his/her final goal, Orthopedic specialization.