Linux Network Properties Configuration--ifcfg command Family

Source: Internet
Author: User

Ifconfig command

    • Features: You can manually start, view, and modify the parameters of the network interface.
    • Usage:
      • Ifconfig//View NIC information showing activation status by default
      • Ifconfig Etho//display information for the specified NIC
      • IFCONFIG-A//Display information for all network cards
      • Ifconfig INTERFACE Up|down]//Disable or start a network card
      • Ifconfig INTERFACE IP//Set IP
    • eg

     

...

[[Email protected] ~]$ ifconfig ens33ens33:flags=4163<UP,BROADCAST,RUNNING,MULTICAST> MTU theinet172.22.12.233Netmask255.255.0.0Broadcast172.22.255.255Inet6 fe80::7bf5:16a7:f734:b7c4 Prefixlen -ScopeID0x20<link>etherxx: 0c: in: 0f:5d:ea Txqueuelen +(Ethernet) RX packets287788bytes20207460(19.2MiB) RX Errors0Dropped0Overruns0Frame0TX Packets993bytes197981(193.3KiB) TX Errors0Dropped0Overruns0Carrier0Collisions0

Gives the specified IP address and activates

1, way one: #ifconfig Ifaceip/mask [up]

[Email protected]~]# ifconfig eno16777736192.168.10.100/ -Up[[email protected]~]# ifconfig eno16777736:flags=4163<UP,BROADCAST,RUNNING,MULTICAST> MTU theinet192.168.10.100Netmask255.255.255.0Broadcast192.168.10.255Inet6 fe80::20c:29ff:fee5:2d6a Prefixlen -ScopeID0x20<link>etherxx: 0c: in: e5:2d:6a Txqueuelen +(Ethernet) RX packets126bytes44856(43.8KiB) RX Errors0Dropped0Overruns0Frame0TX Packets341bytes63010(61.5KiB) TX Errors0Dropped0Overruns0Carrier0Collisions0

2, way two: #ifconfig Ifaceip netmask netmask

[Email protected]~]# ifconfig eno16777736192.168.10.101Netmask255.255.255.0[[Email protected]~]# ifconfig eno16777736:flags=4163<UP,BROADCAST,RUNNING,MULTICAST> MTU theinet192.168.10.101Netmask255.255.255.0Broadcast192.168.10.255Inet6 fe80::20c:29ff:fee5:2d6a Prefixlen -ScopeID0x20<link>etherxx: 0c: in: e5:2d:6a Txqueuelen +(Ethernet) RX packets126bytes44856(43.8KiB) RX Errors0Dropped0Overruns0Frame0TX Packets343bytes63150(61.6KiB) TX Errors0Dropped0Overruns0Carrier0Collisions0

Note: The network configuration of the Ifconfig command is valid only for the current system

In the remote SSH is best not to use, may be different network environment, once not effective, may have to run to the computer room to reset

    • Configure multiple network IP addresses for the same network interface: How to alias an interface name
      • Dynamic mode:

Ifconfig eth0:# IP netmask MASK, such as Ifconfig eth0:0 192.168.1.177 netmask 255.255.255.0

      • static mode

Create a/etc/sysconfig/network-scripts/ifcfg-eth0:0 file and configure it. Note that the device=eth0:0 in the file, and the IP address at the interface cannot be obtained dynamically, need to be set manually.

Note: When configuring multiple IP addresses on a network card, such as eth0, eth0:0, if the network card on the Eth0:0,eth0 is still in effect. However, when the physical network card is banned directly (that is, eth0), the configuration (eth0:0) will be removed.

    • Promiscuous mode of NIC
      • Implementation: # Ifconfig eth0 Promisc
      • Cancel: # ifconfig Eth0-promisc

  

Linux Network Properties Configuration--ifcfg command Family

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.