Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use the route command in Linux

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

In view of how to use the route command in Linux, this article introduces the corresponding analysis and answer in detail, hoping to help more partners who want to solve this problem to find a more simple and easy way.

Route

1. Action

Route means to manually generate, modify, and view routing tables.

two。 Format

# route [- add] [- net |-host] targetaddress [- netmask Nm] [dev] If]

# route [- delete] [- net |-host] targetaddress [gw Gw] [- netmask Nm] [dev] If]

3. Main parameters

-add: add routes.

-delete: delete the route.

-net: the route reaches a network, not a host.

-host: the route reaches a host.

-netmask Nm: specifies the subnet mask of the route.

Gw: specifies the gateway of the route.

[dev] If: forces the routing chain to specify an interface.

4. Application example

The route command is used to view and set the routing information of the Linux system in order to communicate with other networks. To achieve communication between two different subnets, you need a router connecting two networks, or a gateway located in both networks. In Linux systems, routing is usually set up to solve the following problems: the Linux system has a gateway in a local area network, which allows the machine to access the Internet, so it is necessary to set the IP address of this machine to the default route of the Linux machine. Use the following command to add a default route:

Route add 0.0.0.0 192.168.1.1

Rlogin

1. Action

Rlogin is used for remote registration.

two。 Format

Rlogin [- 8EKLdx] [- e char] [- k realm] [- l username] host

3. Main parameters

-8: this option always allows 8-bit input data channels. This option allows formatted ANSI characters and other special codes to be sent. If this option is not used, the parity bit is removed unless the termination and startup characters are not at the remote end.

-E: stop treating any character as an escaped character. When used with the-8 option, it provides a fully transparent connection.

-K: turn off all Kerberos confirmations. Use this option only when connecting to a host that uses the Kerberos acknowledgement protocol.

-L: allows rlogin sessions to run in litout mode. For more information, refer to the tty online help.

-d: open socket debugging for TCP sockets that communicates with the remote host. For more information, refer to the online help for setsockopt.

-e: sets the escape character for the rlogin session. The default escape character is "~".

-k: request rlogin to obtain the Kerberos license of the remote host within the specified area, rather than the Kerberos license of the remote host within the remote host area determined by krb_realmofhost (3).

-x: turns on DES encryption for all data transmitted through the rlogin session. This affects response time and CPU utilization, but improves security.

4. instructions

If you have accounts on different systems in the network, or you can access other people's accounts on another system, you must first register in the system to access accounts in other systems. then register remotely to the system where the account is located through the network. Rlogin can be registered remotely to another system, and its parameter should be a system name.

Rcp

1. Action

Rcp stands for remote file copy and is used to copy files between computers, with permissions for all users.

two。 Format

Rcp [- px] [- k realm] file1 file2 rcp [- px] [- r] [- k realm] file

3. Main parameters

-r: recursively copy everything in the source directory to the destination directory. To use this option, the destination must be a directory.

-p: attempts to preserve the modification time and mode of the source file, ignoring umask.

-k: request rcp to obtain the Kerberos license of the remote host within the specified area, rather than the Kerberos license of the remote host within the remote host area determined by krb_relmofhost (3).

-x: turn on DES encryption for all data transferred.

Finger

1. Action

Finger is used to query the login account information on a host. It usually displays the user name, home directory, stagnation time, login time, login Shell and other information. The permission is for all users.

two。 Format

Finger [option] [user] [user @ host]

3. Main parameters

-s: displays user registration name, actual name, terminal name, write status, stagnation time, login time and other information.

-l: in addition to the information displayed with the-s option, it also displays information such as the user's home directory, login Shell, mail status, and the contents of .plan, .project, and .forward files under the user's home directory.

-p: same as the-l option except that .plan and .project files are not displayed.

4. Application example

Use finger on your computer:

[root@localhost root] # Finger

Login Name Tty Idle Login Time Office Office Phone

Root root tty1 2 Dec 15 11

Root root pts/0 1 Dec 15 11

Root root * pts/1 Dec 15 11

5. Application description

If you want to query the user information on the remote machine, you need to follow the user name with "@ hostname" in the format of [username @ hostname], but the network host to be queried needs the support of running the finger daemon.

Mail

1. Action

The function of mail is to send email, and the permission is for all users. In addition, mail is an email program.

two。 Format

Mail [- s subject] [- c address] [- b address]

Mail-f [mailbox] mail [- u user]

3. Main parameters

-b address: represents the anonymous recipient address list of the output information.

-c address: represents the list of CC () recipient addresses of the output information.

-f [mailbox]: reads messages from the mailbox specified by the inbox.

-s subject: specifies the body line of the output information.

[- u user]: the port specifies the optimized inbox to read mail.

This is the answer to the question about how to use the route command in Linux. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel for more related knowledge.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report