Why do I need to activate the NIC every time I restart the system?

Source: Internet
Author: User
Why do you need to activate the NIC-Linux general technology-Linux technology and application information every time you restart the system? For more information, see the following. [I = s] This post was last edited by tomgao83 at, 2011-4-1

I started to use Vmware to learn linux. I used fedora. After each restart, the NIC needs to be manually activated. I don't know what's going on?

[Root @ localhost ~] # Ifconfig
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: 2564 errors: 0 dropped: 0 overruns: 0 frame: 0
TX packets: 2564 errors: 0 dropped: 0 overruns: 0 carrier: 0
Collisions: 0 txqueuelen: 0
RX bytes: 128360 (125.3 KiB) TX bytes: 128360 (125.3 KiB)
[Root @ localhost ~] # Ifup eth0
[Root @ localhost ~] # Ifconfig
Eth0 Link encap: Ethernet HWaddr 00: 0C: 29: 15: 32: 81
Inet addr: 192.168.88.188 Bcast: 192.168.88.255 Mask: 255.255.255.0
Inet6 addr: fe80: 20c: 29ff: fe15: 3281/64 Scope: Link
Up broadcast running multicast mtu: 1500 Metric: 1
RX packets: 32 errors: 0 dropped: 0 overruns: 0 frame: 0
TX packets: 15 errors: 0 dropped: 0 overruns: 0 carrier: 0
Collisions: 0 FIG: 1000
RX bytes: 3840 (3.7 KiB) TX bytes: 2674 (2.6 KiB)
Interrupt: 19 Base address: 0x2000

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: 2564 errors: 0 dropped: 0 overruns: 0 frame: 0
TX packets: 2564 errors: 0 dropped: 0 overruns: 0 carrier: 0
Collisions: 0 txqueuelen: 0
RX bytes: 128360 (125.3 KiB) TX bytes: 128360 (125.3 KiB)

I searched the internet and used the following method to automatically activate the NIC after each startup.

Q: Is this true for all linux systems? Or my problem?



[Root @ localhost ~] # More/etc/rc. local // I found it online and added the ifup command
#! /Bin/sh
#
# This script will be executed * after * all the other init scripts.
# You can put your own initialization stuff in here if you don't
# Want to do the full Sys V style init stuff.

Touch/var/lock/subsys/local
Ifup eth0

The NIC is automatically activated after restart.

[Root @ localhost ~] # Ifconfig
Eth0 Link encap: Ethernet HWaddr 00: 0C: 29: 15: 32: 81
Inet addr: 192.168.88.188 Bcast: 192.168.88.255 Mask: 255.255.255.0
Inet6 addr: fe80: 20c: 29ff: fe15: 3281/64 Scope: Link
Up broadcast running multicast mtu: 1500 Metric: 1
RX packets: 41 errors: 0 dropped: 0 overruns: 0 frame: 0
TX packets: 17 errors: 0 dropped: 0 overruns: 0 carrier: 0
Collisions: 0 FIG: 1000
RX bytes: 4341 (4.2 KiB) TX bytes: 2976 (2.9 KiB)
Interrupt: 19 Base address: 0x2000

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: 2420 errors: 0 dropped: 0 overruns: 0 frame: 0
TX packets: 2420 errors: 0 dropped: 0 overruns: 0 carrier: 0
Collisions: 0 txqueuelen: 0
RX bytes: 121160 (118.3 KiB) TX bytes: 121160 (118.3 KiB)

Certificate ------------------------------------------------------------------------------------------------------------------------------------------

On the configuration page below, I checked the two options, saved them, and restarted them.

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.