Configure Routing Table

Configure Routing Table

ARTH - Task 13.

Task Description:

?? Create a Setup so that you can ping google but not able to ping Facebook from the same system.

Let's Start to configure...

For this task, I am using RedHat Linux Virtual Machine as my local system, which has IP - 192.168.101.7 to find the IP use the cmd:

# ifconfig enp0s3
No alt text provided for this image

Check Routing Table:

  # route -n

No alt text provided for this image

In my route table rule first rule is whenever we need to go public world then the system will use "192.168.101.1". But we want our system to only connect to the Google server, not the Facebook server.

First, check the connectivity of our local system to both the google and Facebook server, for that use the Ping cmd.

* Check Googe is pingable or not - ( It is pingable)

  # ping www.google.com

No alt text provided for this image

* Check Facebook is pingable or not - (It is also pingable)

  # ping www.facebook.com

No alt text provided for this image

Now we have to configure Routing Table Rules:

1.Delete "0.0.0.0" destination routing table rule:

# route del -net 0.0.0.0 enp0s3

No alt text provided for this image

2.Add Routing Table Rule For Google IPs:

I will only configure a rule for one IP Range ("172.217.0.0 - 172.217.31.255")

# route add -net 172.217.0.0/16 gw 192.168.101.1 enp0s3

"192.168.101.1" is my Router or gateway

No alt text provided for this image

Now ping to google server and the Facebook server:

  # ping google.com

No alt text provided for this image
# ping facebook.com

No alt text provided for this image

We see our system is not able to ping Facebook server IP

Now we have configured the routing table In Such a Way So That We Can Ping Only the Google server Not the FaceBook server.

Thank you...







要查看或添加评论,请登录

Anand Kumar的更多文章

社区洞察

其他会员也浏览了