Add and delete routes in Linux/Windows

Source: Internet
Author: User

In Linux/window, add a route entry: route add-net 191.0.0.0 netmask route 0.0.0 dev eth0 delete a route entry: route del-net 191.0.0.0 netmask route 0.0.0 dev eth0 add a default route: route add default gw 160.19.4.254 Delete the default route: route del default gw 160.19.4.254 or route del default route adding method in linux: Use the route command to add the route, after the machine is restarted or the NIC is restarted, the route becomes invalid. Method: // route added to the host # route add-host 192.168.168.110 dev eth0 # route add-host 192.168.168.119 gw 192.168.168.1 // route added to the network # route add-net IP netmask MASK eth0 # route add-net IP netmask MASK gw IP # route add-net IP/24 eth1 // add default Gateway # route add default gw IP // Delete route # route del-host 192.168.168.110 dev in linux, how does eth0 set a permanent route: 1. in/etc/rc. add route add-net 192.168.3.0/24 dev eth0 route add-net 192.168.2.0/24 gw 192.168.3.254 2. add to the end method in/etc/sysconfig/network: GATEWAY = gw-ip or GATEWAY = gw-dev 3. /etc/sysconfig/static-router: any net x. x. x. x/24 gw y. y. y. y window adds a route deletion: route add 160.0.0.0 mask route 0.0.0 local IP-p route delete 160.0.0.0

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.