How to set up linux gateway

coldplay.xixi
Release: 2020-08-31 14:36:08
Original
27528 people have browsed it

How to set up the Linux gateway: first use xshell to log in to the Linux server; then use ip add to check the local address and manually add a route; finally write the route add command into the configuration file.

How to set up linux gateway

【Recommended related articles: linux tutorial

How to set up the Linux gateway:

Step 1: Use xshell to log in to our Linux server. This machine uses centos6.5,

How to set up linux gateway

Step 2: Use route -n to view the routing table of this machine and see that this machine has no default route

How to set up linux gateway

Step 3: Use ip addView the local address, the local address is 192.168.101.2, set the planned gateway to 192.168.101.254

How to set up linux gateway

Step 4: Manually add a route

route add default gw 192.168.101.254 to add a default gateway, and then route -n to see that the route has taken effect

How to set up linux gateway

Step 5: Using the route add command to add it will only take effect temporarily and will restart. Lost, you need to write it into the configuration file. Follow the following configuration to take effect permanently

vim/etc/sysconfig/network

GATEWAY=192.168.101.254

How to set up linux gateway

If you want to know more about programming learning, please pay attention to the php training column!

The above is the detailed content of How to set up linux gateway. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!