Linux Network commands

Source: Internet
Author: User

One, add the route under Linux

1. Add default gateway: Route add default GW 192.168.1.1 or route add default dev eth1

2. Add route: Route add-net 172.16.1.0 netmask 255.255.255.0 GW 172.16.1.1

Route add-net 172.16.1.0 netmask 255.255.255.0 Dev eth0

3. Add a host route: Route add-host 172.16.1.1 GW 172.16.1.10

Route add-host 172.16.1.1 Dev eth0

4. Delete: Route del [Default/-host/-net]

5. View route: Route-n or Netstat-rn

Destination Gateway genmask Flags Metric Ref use Iface

192.168.60.3 192.168.60.1 255.255.255.255 UGH 0 0 0 eth1

172.17.46.0 172.17.46.1 255.255.255.0 UG 0 0 0 eth0

172.17.46.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0

192.168.60.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1

0.0.0.0 172.17.46.1 0.0.0.0 UG 0 0 0 eth0

0.0.0.0 192.168.60.2 0.0.0.0 UG 0 0 0 eth1


This article is from the "Laoyaowst" blog, make sure to keep this source http://laoyaowst.blog.51cto.com/6113216/1543566

Linux Network commands

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.