Configure the Linux network card address

Source: Internet
Author: User

Ifconfig Viewing network card information
The first type of configuration
Vim/etc/sysconfig/network-scripts/ifcfg-eth0

Device= the device name associated with "eth0" to be consistent with the second half of the file name "Eth0"
Onboot= "Yes" activates this network interface automatically when it is powered on
HWADDR=00:0C:29:3B:7B:58 hardware address, to be consistent with the address in the hardware: Save
Gateway= "192.168.100.1" Set default gateway
ipaddr=192.168.100.150 IP Address
prefix=24 Subnet Prefix
bootproto=static [STATIC|NONE|DHCP|BOOTP]: Boot protocol: To use a static address, static or none:dhcp means to obtain an address using a DHCP server:

The second type of configuration
Setup--->network configuration--->device configuration---> select NIC eth0---> Fill in IP information
Both of these configurations must be restarted: Service network restart


Temporary configured IP address: ifconfig eth0 192.168.1.1/24 [Up/down] effective immediately (restart Network service is disabled)


IFCONFIG-A Display all interface configuration information

vim/etc/resolv.conf Configuring DNS


Firewall settings
Open: Service iptables start
Close: Service iptables stop


Configure the Linux network card address

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.