Linux System Configuration Nic method
Method One: Set up the network card via the Setup command
[[Email protected] ~]# Setup
650) this.width=650; "style=" Float:none; "title=" 1.png "src=" http://s3.51cto.com/wyfs02/M00/75/44/ Wkiol1y0xvoxi3bvaac2w18xh9o957.jpg "alt=" Wkiol1y0xvoxi3bvaac2w18xh9o957.jpg "/>
Figure 1-1 Selecting the network configuration
650) this.width=650; "style=" Float:none; "title=" 2.png "src=" http://s3.51cto.com/wyfs02/M01/75/47/ Wkiom1y0xruhohmbaacqjut_t7i068.jpg "alt=" Wkiom1y0xruhohmbaacqjut_t7i068.jpg "/>
Figure 1-2 Selecting pevice configurarion
650) this.width=650; "style=" Float:none; "title=" 3.png "src=" http://s3.51cto.com/wyfs02/M01/75/44/ Wkiol1y0xvphvgoraadfjsl2skm977.jpg "alt=" Wkiol1y0xvphvgoraadfjsl2skm977.jpg "/>
Figure 1-3 Select eth0 to indicate a certain block of NIC
650) this.width=650; "style=" Float:none; "title=" 4.png "src=" http://s3.51cto.com/wyfs02/M02/75/47/ Wkiom1y0xrvqbwknaadzlg8ver0963.jpg "alt=" Wkiom1y0xrvqbwknaadzlg8ver0963.jpg "/>
Figure 1-4 Configuring the IP address, subnet mask, gateway, DNS
650) this.width=650; "style=" Float:none; "title=" 5.png "src=" http://s3.51cto.com/wyfs02/M02/75/44/ Wkiol1y0xvtjkbz2aacufybufre141.jpg "alt=" Wkiol1y0xvtjkbz2aacufybufre141.jpg "/>
Figure 1-5 Choosing Save
650) this.width=650; "style=" Float:none; "title=" 6.png "src=" http://s3.51cto.com/wyfs02/M00/75/47/ Wkiom1y0xrugtteaaacgurksvc8023.jpg "alt=" Wkiom1y0xrugtteaaacgurksvc8023.jpg "/>
Figure 1-6 Selecting save&quit
Method Two: Modify the configuration file/etc/sysconfig/network-scripts/ifcfg-eth0 set the permanent active IP address
[Email protected] ~]# Vim/etc/sysconfig/network-scripts/ifcfg-eth0
device=eth0 # Device Name
hwaddr=00:0c:29:9d:5e:9d #MAC Address
type=ethernet # Ethernet Network
uuid=17d2fd2e-3b4d-4853-ae44-94d3990b86d0 # network card UUID (unique identification number)
onboot=yes # whether to turn on the boot NIC (yes)
ipaddr=192.168.1.11 #IP Address
netmask=255.255.255.0 # Subnet Mask
gateway=192.168.1.8 # Gateway
dns1=202.96.128.143 #DNS
nm_controlled=yes # real-time, no need to restart the NIC immediately after the modification takes effect.
bootproto= static # Specify how to get IP address static (static) DHCP (dynamic) None (not specified)
[email protected] ~]#/etc/init.d/network restart # Restart the NIC
Shutting down interface Eth0:device State:3 (disconnected)
[ ok ]
Bringing up loopback interface: [OK]
Bringing up interface eth0:active connection state:activated
active Connection path:/org/freedesktop/networkmanager/ ACTIVECONNECTION/7
[ ok ]
[email protected] ~]# ping www.baidu.com #ping whether the external network is through
PING www.a.shifen.com (119.75.218.70) bytes of data.
Bytes from 119.75.218.70:icmp_seq=1 ttl=54 time=43.0 ms
Bytes from 119.75.218.70:icmp_seq=2 ttl=54 time=43.3 ms
^c
---www.a.shifen.com ping statistics---
2 packets transmitted, 2 received, 0% packet loss, time 1779ms
RTT Min/avg/max/mdev = 43.084/43.197/43.310/0.113 ms
Restart the NIC method
Method One:
Ifdown eth0
Ifup eth0
Method Two:
/etc/init.d/network restart
Method Three:
Service Network restart
To turn off the NIC method
Method One:
Ifdown eth0
Method Two:
/etc/init.d/network stop
Method Three:
Service Network Stop
This article is from the "Breeze Cool" blog, please be sure to keep this source http://jiay1.blog.51cto.com/9144615/1708335
Linux System network Card configuration method