General Usage of Linux Route

Source: Internet
Author: User

General Usage of Linux Route

Route ConfigurationRoute

Route: displays or configures local route information.

The main configuration information of a route table configuration is:

Configuration item

Meaning

Target

Destination Ip host address or Ip address

Gw

Next Hop address

Dev

Next Hop Network Interface

If an ip report needs to be sent from the local machine or an ip datagram is forwarded, Linux will first find out whether the Target ip address matches the Target configuration in the route information table maintained by the system, if yes, the ip address is sent to the address specified by Gw in the configuration. if no route configuration is found, the datagram is sent to the defaultThe gateway address.

Usage:

Route [options]

Instance used:

A) display route informationRoute-n

B) set the default value.Gateway Configuration

Route add default gw 192.168.9.1 dev eth1

C) delete the default value.Gateway Configuration

Route del default gw 192.168.9.1 dev eth1

D)Route entry added to the target host:

Route add-host 192.168.9.8 gw 192.168.9.1 dev eth1

E)Route entry added to the target network:

Route add-host 192.168.9.8 netmask 255.255.255.0 gw 192.168.9.1 dev eth1

F) Route entries to the target host:

Route del-host 192.168.9.8 gw 192.168.9.1 dev eth1

G) Route entries to the target network:

Route del-host 192.168.9.8 netmask 255.255.255.0 gw 192.168.9.1 dev eth1

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.