‫So now let's talk
‫about another routing policy
‫called the IP-based Routing
‫which is very intuitive to think about
‫because you're going to define the routing based
‫on the client IP addresses.
‫In Route 53, you're going to define a list of CIDRs,
‫they are IP ranges for your clients,
‫and you're going to say, based on the CIDR
‫which location the traffic should be sent to.
‫So the use cases will be to optimize performance
‫because you know the IP ahead of time
‫or to reduce network costs
‫because you know where the IPs are coming from.
‫So an example is that if you know
‫that you have a specific internet provider
‫and they are using a specific CIDR of IP addresses
‫you can route them
‫to a specific endpoint thanks to this strategy.
‫So let's go for an example.
‫In Route 53, I'm going to define two locations
‫with two different CIDR blocks.
‫As you can see, one start with 203
‫and the other one start with 200 and the defined IP ranges.
‫Now we are going to link these locations
‫to a specific record.
‫So for example.com we're going to have location one.
‫So the first CIDR block to send
‫to the value 1.2.3.4,
‫and the second location, the CIDR block number two,
‫to send it to 5.6.7.8.
‫And these represents the public IP of two EC2 instances.
‫Now, as you would expect, if a user comes in
‫with a specific IP that is part
‫of the location one CIDR block, they will be directed
‫to the first EC2 instance of IP 1.2.3.4,
‫and the user B, with a second IP address
‫that belongs to the location two,
‫will be redirected and will have a DNS query response
‫to the EC2 instance of IP 5.6.7.8.
‫And that's it for IP based routing.
‫It's very simple and I hope you liked it.
‫I will see you in the next lecture.