Example: Linux view and manipulate IP routing table methods

Source: Internet
Author: User
Tags ssh access

Example: Linux view and manipulate IP routing table methodsListen to the Voice
    • |
    • Browse:2933
    • |
    • Updated: 2015-10-17 10:07
    • |
    • Tags:linux
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
Step through Reading

The route command for the Linux system is used to display and manipulate the IP routing table (show/manipulate the IP routing table). To achieve communication between two different subnets, you need a router that is connected to two networks, or a gateway to two networks. This article will be an example of Linux view and operation of the IP routing table method, external network SSH access to the intranet Linux.

Method/Step
  1. 1

    Usage examples:

    Example 1: Displaying the current route

    Route or Route-n

    Description

    The first line indicates that the host network address is 192.168.120.0, if the data transmission target is in the local area network communication, you can forward the packet directly through the eth0;

    Row four indicates that the data transfer purpose is to access the Internet, then the interface eth0 to send the packet to the gateway 192.168.120.240

    Where flags is the route flag that marks the state of the current network node.

    Note:

    Route-n (-n means not resolving names, listing faster than route)

    After the introduction, we will use an example to explain the extranet SSH access to the intranet Linux method.

  2. 2

    Example 2: Add a gateway/set up a gateway

    Command:

    Route add-net 224.0.0.0 netmask 240.0.0.0 Dev eth0

  3. 3

    Example 3: Masking a route

    Command:

    Route add-net 224.0.0.0 netmask 240.0.0.0 Reject

  4. 4

    Example 4: Delete a route record

    Command:

    Route del-net 224.0.0.0 netmask 240.0.0.0 Route del-net 224.0.0.0 netmask 240.0.0.0 Reject

    Example 5: Delete and add set default gateway

    Command:

  5. 5

    Extranet SSH Access intranet linux-full port mapping implementation method:

    Ensure that the intranet application is normal.

    Clear the intranet Linux access address, and ensure that the Linux Server SSH service is normal.

    Install Nat123 client Linux on the access-side Linux server and use it. Landing.

    Left User Center, add port mappings. Select the full port mapping type. Fill in the intranet Linux fixed address port, and the domain name that the extranet accesses. You can use your own domain name, or you can use a level two domain name. Place the mouse in the input box with a wizard prompt.

  6. 6

    The extranet access terminal installs the Nat123 client and uses the visitor.

    The visitor opens the Linux full port mapped domain name and access port. If the destination address port is added, the LAN access is also checked, and it can be accessed within the visitor's LAN.

  7. 7

    You can put the mouse on the visitor's icon, to see the status prompt, whether normal or abnormal, there is a corresponding status detection prompt information. If the display port is open, it indicates that the port can be accessed normally, and if there are other exception prompts, it may be resolved according to specific instructions.

    You can access Linux by using a native of the visitor. The access address is the domain port that the local visitor opens.

    END
experience content is for reference only, if you need to solve specific problems (especially in the areas of law, medicine, etc.),

Example: Linux view and manipulate IP routing table methods

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.