CentOS Delete default route

Source: Internet
Author: User

Describe:

The virtual machine installed CentOS, the installation network is configured to fixed IP, the system installed and added a network card port, and positioning as a bridge mode, and the original network card is changed to DHCP to obtain the IP address, and as a public network export.

The problem comes, the network card configuration is correct, but also commented on the fixed IP gateway, but after restarting the Network service, found unable to access the Internet, then thought it might be the default route does not change over

#route  -nDestination     Gateway          Genmask         Flags Metric Ref     Use Iface192.168.1.0     0.0.0.0          255.255.255.0   U     0       0        0 eth1192.168.192.0   0.0.0.0          255.255.255.0   U      0      0        0  eth0169.254.0.0     0.0.0.0          255.255.0.0     u     1002   0         0 eth0169.254.0.0     0.0.0.0          255.255.0.0     U     1003   0         0 eth10.0.0.0          192.168.1.1   0.0.0.0         UG     0      0        0 eth0

Look at the next routing table, the reason for the default route, delete it, add the static route again

#route del-net 0.0.0.0 netmask 0.0.0.0 GW 192.168.1.1#route add-net 0.0.0.0 netmask 0.0.0.0 GW 192.168.192.1

This change came, but the problem is not completely resolved, after restarting the network service, the default route is changed back

Best of all, in order to use the time, think of the system inside there is a location is set the default route, that is,/etc/sysconfig/network file, a view, sure enough in the definition of the default gateway, delete, fix

#cat/etc/sysconfig/network networking=yeshostname=nagios#gateway=192.168.1.1


This article is from the "Morrowind" blog, make sure to keep this source http://morrowind.blog.51cto.com/1181631/1696138

CentOS Delete default route

Related Article

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.