Reputation: 611
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 ?
Upvotes: 42
Views: 27352
Reputation: 1
Example:
This means that any packet destined for a network address within the 192.168.1.0/24 subnet should be forwarded to the router at 192.168.2.1. The router will then determine the next hop based on its own routing table.
Upvotes: 0
Reputation: 19
destination is just destination.
target is next hop, but different from on premises, next hop don't use IP address but identifier
Upvotes: 1
Reputation: 726
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.
Upvotes: 2
Reputation: 983
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
Upvotes: 6
Reputation: 5135
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.
Upvotes: 48
Reputation: 2327
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.
Upvotes: 28
Reputation: 43662
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.
Upvotes: 33