Centos automatically starts the network

Source: Internet
Author: User
Centos60 (Final) version system originally installed on a virtual machine. after installation, it is not logged on to the virtual machine by default because the crt is used for each login, crt cannot be connected (Nic not started ). Next, let's modify and view the network card used. [Hcr @ slave2

Centos6.0 (Final) version system originally installed on a virtual machine. after installation, it is not logged on to the virtual machine by default because the crt is used for each login, crt cannot be connected (Nic not started ).

Next, modify it.

Check the network card used.

[Hcr @ slave2 ~] $ Ifconfig

Eth1 Link encap: Ethernet HWaddr 00: 0C: 29: 8C: BF: DF
Inet addr: 192.168.1.13 Bcast: 192.168.1.255 Mask: 255.255.255.0
Inet6 addr: fe80: 20c: 29ff: fe8c: bfdf/64 Scope: Link
Up broadcast running multicast mtu: 1500 Metric: 1
RX packets: 220 errors: 0 dropped: 0 overruns: 0 frame: 0
TX packets: 217 errors: 0 dropped: 0 overruns: 0 carrier: 0
Collisions: 0 fig: 1000
RX bytes: 21357 (20.8 KiB) TX bytes: 26980 (26.3 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: 4 errors: 0 dropped: 0 overruns: 0 frame: 0
TX packets: 4 errors: 0 dropped: 0 overruns: 0 carrier: 0
Collisions: 0 txqueuelen: 0
RX bytes: 240 (240.0 B) TX bytes: 240 (240.0 B)

Then go to the linux network configuration Directory

[Hcr @ slave2 ~] $ Cd/etc/sysconfig/network-scripts modify the Nic configuration as follows (ONBOOT = yes auto-start configuration)
[Hcr @ slave2 network-scripts] $ cat ifcfg-eth1
DEVICE = "eth1"
NM_CONTROLLED = "yes"
ONBOOT = yes
TYPE = Ethernet
BOOTPROTO = none
DEFROUTE = yes
20174_failure_fatal = yes
IPV6INIT = no
NAME = "System eth1"
IPADDR = 192.168.1.13
PREFIX = 24
GATEWAY = 192.168.1.1
HWADDR = 00: 0C: 29: 8C: BF: DF

After the configuration, restart the crt connection operation. you do not need to log on to the VM every time.

Related Article

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.