Use the ifupdown logical interface definition for advanced network settings

Source: Internet
Author: User

The physical (physical) interface for advanced network settings defined by the ifupdown logical interface is what we call the "interface", which is named by the kernel eth0, eth1, ppp0, or others. A logical interface is a set of values that can be used to set variable parameters of a physical interface. If you do not think it is clear, you can use the "X configuration file to set interfaces" instead of "set logical interface X" during reading ". In/etc/network/interfaces, iface is actually defined as a logical interface, rather than a physical interface. If you never reconfigure your interface, you can ignore this detail. The physical interface foo is set to logical interface foo by default. Assume that your computer is a notebook and you need to shuttle between your home and work place. When your computer is connected to the company network or home network, you must set eth0 accordingly. First, define two logical interfaces home and work (replace eth0, as we previously did), which respectively describe how to set interfaces at home and on the company's network. Iface home inet staticaddress 192.168.0.123netmask 255.255.255.0gateway 192.168.0.1 iface work inet staticaddress 81.201.3.123netmask 255.255.0.0gateway 81.201.1.1 and then specify these settings through appropriate settings in the command line. The physical interface eth0 can be activated in the home network: # ifup eth0 = home to reset eth0 for the company network as long as you run these commands: # ifdown eth0 # ifup eth0 = work note! If the content in interfaces is as described above, we cannot separately execute ifup eth0 to activate eth0. The reason is that ifup uses the physical interface name as the default logical interface name, but in our example, the logical interface eth0 is not defined.
 

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.