Network Interface configuration file
[email protected] ~]# Cat/etc/sysconfig/network-scripts/ifcfg-eth0
# Intel Corporation 82545EM Gigabit Ethernet Controller (Copper)
Type=ethernet #网卡类型
Device=eth0 #网卡接口名称
Onboot=yes #系统启动时是否自动加载
Bootproto=static #启用地址协议--static: Static protocol--BOOTP Protocol--DHCP Protocol
ipaddr=192.168.1.11 #网卡IP地址
netmask=255.255.255.0 #网卡网络地址
gateway=192.168.1.1 #网卡网关地址
dns1=10.203.104.41 #网卡DNS地址
hwaddr=00:0c:29:13:5d:74 #网卡设备MAC地址
broadcast=192.168.1.255 #网卡广播地址Re-import the Ifcfg-eth0 network configuration file
[Email protected] ~]#/etc/init.d/network Reload
Shutting down interface eth0: [OK]
Shutting down loopback interface: [OK]
Bringing up loopback interface: [OK]
Bringing Up interface eth0: [OK]
Nic interface shutdown and activation
[Email protected] ~]# ifdown eth0 #关闭网络
[Email protected] ~]# ifup eth0 #启动网络
Network Service startup and shutdown
Method One:
[[Email protected] ~]# service network stop #关闭网络服务
[Email protected] ~]# service network start #启动网络服务
[Email protected] ~]# service network restart #重启网络服务
Method Two:
[[email protected] ~]#/etc/init.d/network stop
[[email protected] ~]#/etc/init.d/network start
[[email protected] ~]#/etc/init.d/network restart NIC status query
[Email protected] ~]# service network status
Configured devices:
Lo eth0
Currently active devices:
Lo eth0
Temporary configuration of network card information without rebooting.
[[email protected] ~]# ifconfig eth0 10.1.1.10 netmask 255.0.0.0 View NIC interface information, all interfaces are listed by default
[Email protected] ~]# ifconfig
Eth0 Link encap:ethernet HWaddr 00:0c:29:13:5d:74
inet addr:192.168.1.11 bcast:192.168.1.255 mask:255.255.255.0
Inet6 ADDR:FE80::20C:29FF:FE13:5D74/64 Scope:link
Up broadcast RUNNING multicast mtu:1500 metric:1
RX packets:413 errors:0 dropped:0 overruns:0 frame:0
TX packets:572 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:47701 (46.5 KiB) TX bytes:64842 (63.3 KiB)
Base address:0x2000 memory:d8920000-d8940000
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:407 errors:0 dropped:0 overruns:0 frame:0
TX packets:407 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:70759 (69.1 KiB) TX bytes:70759 (69.1 KiB) View current Routing and gateway Information
[Email protected] ~]# Netstat-r
Kernel IP Routing Table
Destination Gateway genmask Flags MSS Window Irtt Iface
192.168.1.0 * 255.255.255.0 U 0 0 0 eth0
169.254.0.0 * 255.255.0.0 U 0 0 0 eth0
Default 192.168.1.1 0.0.0.0 UG 0 0 0 eth0 DNS: hostname: CentOS master dns:202.106.46.151 second dns:202.106. 0.20 third dns:8.8.8.8 network configuration: eth0 static ip:192.168.1.106 subnet mask 255.255.255.0 default gateway IP 192.168.1.1 device=eth0ipaddr=192.168.1.1 06netmask=255.255.255.0broadcast=192.168.1.255onboot=yesbootproto=nonegateway=192.168.1.1type=ethernet "/etc/ Sysconfig/network-scripts/ifcfg-eth0 "11L, 187C
"Share" Linux under Ifcfg-eth0 configuration