When Linux encounters multiple NICs

Source: Internet
Author: User

My virtual machine has three network cards, there are two in use, respectively, is a different network segment

  1. Eth4:192.168.100.6/24
  2. Eth6:192.168.137.131/24

But the default system sets my internal network eth6 to the place where all IP addresses need to go, as follows

~ $ip Route
192.168.100.0/24 Dev eth4 proto kernel scope link src 192.168.100.6
192.168.137.0/24 Dev eth6 proto kernel scope link src 192.168.137.131
169.254.0.0/16 Dev Eth4 scope link metric 1002
169.254.0.0/16 Dev eth6 scope link metric 1003
Default via 192.168.137.1 Dev Eth6

So execute the following command as Root

IP route del default
IP route add default via 192.168.100.1
Delete the default gateway interface Eth6, add the defaults to the Eth4 gateway, where default is the/etc/networks file from CentOS, and the default alias is 0.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.