First, the network settings
1, ip address View
Desired scene: remote connection, configuration software (VPN)
instruction: #ifconfig
information that are:
① there are two cards, called eth0, another LO (local loopback adapter, native IP)
② IP address inet addr that a
2, NIC configuration file
Location: / etc / sysconfig / network- scripts / ifcfg- * File
ONBOOT: Indicates whether to automatically connect
BOOTPROTO (COL): card protocol used after start, under normal circumstances is the DHCP
the HWADDR: hardware address (mac address, physical address), communication between computers are dependent on the mac address (ARP)
Extended: like for NIC configuration file directory level deeper, if required frequent changes can be required to set up a shortcut to the file, which often operate on directories to simplify subsequent open file operations.
Syntax: #ln -s original path shortcut path
Case: The ifcfg-eth0 file to create a shortcut home in the root directory.
#ln -s /etc/sysconfig/network-scripts/ifcfg-eth0 /root/wangka.conf
In the Create Shortcut when the original path sure to write the full absolute path, otherwise the latter will not find the original file.
3, the network service operations (understand)
Can restart the network service via the service command / stop / start operation.
Syntax: #service network start/stop/restart
(NIC operation of all devices)
described above is equivalent to the instructions further:#/etc/init.d/network start/stop/restart
Expanding the user for a single card:
#ifdown 网卡名 停止某个网卡
#ifup 网卡名 启动某个网卡
Note: These operations do not arbitrarily run on the server.