NIC configuration for Linux

Source: Internet
Author: User

Linux network card can be a life temporarily modified, or can be a GUI modification, but our most commonly used is to edit the configuration file to make it permanent, so that we do not need to be like a temporary modification of every boot to reset so much trouble, then let's look at this not troublesome network adapter configuration method It!

  1. First we enter the configuration file for the NIC:


    [[Email protected]~]# vi/etc/sysconfig/network-scripts/ifcfg-eth0//Enter edit


    Device=eth0

    hwaddr=00:0c:29:d0:00:08

    Type=ethernet

    uuid=3849f187-d7be-4641-9321-11786a83277e

    Onboot=yes//self-booting, here means allow

    Nm_controlled=yes

    Bootproto=static//Here is the protocol, we set to static, the default is DHCP (dynamic)

    ipaddr=192.168.12.12//Here is your IP

    NETMASK =255.255.255.0//Here is the mask

  2. Press ESC, and then press and hold shift+: Enter to save the

    : Wq

  3. Enter service network restart restart NIC

    [Email protected] Desktop]# service network restart

    Shutting down interface eth0: [OK]

    Close Loopback interface: [OK]

    Eject loopback interface: [OK]

    Popup interface eth0: Active connection Status: activated

    Active connection path:/ORG/FREEDESKTOP/NETWORKMANAGER/ACTIVECONNECTION/1

    Determine

  4. Input ifconfig view network card parameters


    [[Email protected] Desktop]# ifconfig

    Eth0 Link encap:ethernet HWaddr 00:0c:29:d0:00:08

    inet addr:192.168.136.130 bcast:192.168.136.255 mask:255.255.255.0

    Inet6 ADDR:FE80::20C:29FF:FED0:8/64 Scope:link

    Up broadcast RUNNING multicast mtu:1500 metric:1

    RX packets:12 errors:0 dropped:0 overruns:0 frame:0

    TX packets:334 errors:0 dropped:0 overruns:0 carrier:0

    collisions:0 txqueuelen:1000

    RX bytes:2426 (2.3 KiB) TX bytes:15212 (14.8 KiB)

    Interrupt:19 Base address:0x2024


    Lo Link encap:local Loopback

    inet addr:127.0.0.1 mask:255.0.0.0

    Inet6 addr::: 1/128 scope:host

    Up LOOPBACK RUNNING mtu:16436 metric:1

    RX packets:294 errors:0 dropped:0 overruns:0 frame:0

    TX packets:294 errors:0 dropped:0 overruns:0 carrier:0

    collisions:0 txqueuelen:0

    RX bytes:27382 (26.7 KiB) TX bytes:27382 (26.7 KiB)

  5. Completed.

This article is from the "Darker Notes" blog, so be sure to keep this source http://liumange.blog.51cto.com/9453694/1629059

NIC configuration for Linux

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.