翻译进度
1
分块数量
0
参与人数

Linux 网络:Linux route

这是一篇协同翻译的文章,你可以点击『我来翻译』按钮来参与翻译。


The route command displays and manipulate IP routing table for your system.

A router is a device which is basically used to determine the best way to route packets to a destination.

Syntax:

route  

Route1

Look at the above snapshot, it displays all existing routing table entries on our system.

It shows that if the destination is within the network range of 10.0.0.0 to 10.0.0.255, then the gateway is *, which is 0.0.0.0. This is a special address which represents an invalid or non-existent destination.

Packets which are not within this IP range, will be forwarded to default gateway, which further routes the packet.


Displaying numerical IP address

This command displays output in full numerical form.

Syntax:

route -n  

Route2

Look at the above snapshot, the numerical IP address is displayed.


Adding a default gateway

Packets that are not within the network range are forwarded to the gateway. We can specify this gateway with the following command,

Syntax:

route add default gw <IP address>  

Routing cache information

Kernel maintains a routing cache table to route the packets faster. To list this information, use following command,

Syntax:

route -Cn  

Route3

本文章首发在 LearnKu.com 网站上。

本文中的所有译文仅用于学习和交流目的,转载请务必注明文章译者、出处、和本文链接
我们的翻译工作遵照 CC 协议,如果我们的工作有侵犯到您的权益,请及时联系我们。

原文地址:

译文地址:https://learnku.com/server/wikis/36689

讨论数量: 0
(= ̄ω ̄=)··· 暂无内容!

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!