Description
Computer model Lenovo y-560p
Computer installed dual systems, respectively: win764 bit and centos6.064 bit
Network: Telecom 4m,tp-link Wireless Router
Once installed, the network and wireless networks are as follows:
Ifconfig
View network card and wireless network card information: Iwconfig
Remember the NIC to the MAC address.
Run the Setup command for network configuration.
In this/etc/sysconfig/network-scripts/directory, modify the Ifcfg-eth0
Device=eth0
Bootproto=dhcp
hwaddr=60:eb:69:fc:f5:4e
Ipv6init=no
Ipv6_autoconf=no
Onboot=yes
At the command line, enter:
[root@localhostnetwork-scripts]# Service Network start
Pop-up Loopback interface:
Pop-up interface eth0:
Determining eth0 IP Information ... Complete.
Close link: ifdowneth0, open link: ifupeth0
It's OK to surf the internet now.
Appendix 1: Network Settings
1. Set up network
/etc/sysconfig/network-scripts
(1) Set IP
<1> Modify IP Address
Modify the configuration file for the IP address of the corresponding network card
#
Modify the following content
Device=eth0 (describes the device alias for the network adapter, for example, it is eth0 in the Ifcfg-eth0 file)
Bootproto=static (set up the network card to obtain IP address, possible options for STATIC,DHCP or BOOTP, respectively, corresponding to the static specified IP address, the IP address obtained through the DHCP protocol, the IP address obtained through the BOOTP protocol)
broadcast=192.168.0.255 (corresponding subnet broadcast address)
HWADDR=00:07:E9:05:E8:B4 (corresponding network card physical address)
ipaddr=12.168.1.2 (This field specifies the IP address of the network adapter if you set the network card to obtain an IP address as a static designation)
Ipv6init=no
Ipv6_autoconf=no
netmask=255.255.255.0 (Network mask corresponding to network card)
network=192.168.1.0 (network address corresponding to the NIC)
Onboot=yes (whether this network interface is set when the system is started, when set to Yes, activate the device when the system starts)
<2> Modify Gateway
Modify the configuration file of the gateway for the corresponding network card
#vi/etc/sysconfig/network
Modify the following content
Networking=yes (Indicates whether the system is using the network, typically set to Yes.) If set to no, the network cannot be used, and many system services programs will not start.
Hostname=centos (sets the host name for this machine, where the host name is set to correspond to the hostname set in/etc/hosts)
gateway=192.168.1.1 (Sets the IP address of the gateway for this computer connection.) For example, the gateway is 10.0.0.2)
<3> Modify DNS
To modify the DNS profile of the corresponding network adapter
# vi/etc/resolv.conf
Modify the following content
nameserver202.101.224.68 (domain name server)
nameserver202.101.224.69 (domain name server)
<4> Restart Network configuration
# servicenetwork Restart
Or
#/etc/init.d/network restart
<5> Modify IP Address
Immediate effect:
#ifconfig eth0 192.168.0.2 netmask 255.255.255.0
Start in effect:
Modify/etc/sysconfig/network-scripts/ifcfg-eth0
Modify Gateway DefaultGateway
Immediate effect:
# route adddefault GW 192.168.0.1 Dev eth0
Start in effect:
Modify/etc/sysconfig/network
Modify DNS
Modify/etc/resolv.conf
Can be effective immediately after modification
Modify hostname
Immediate effect:
# HOSTNAMECENTOS1
Start in effect:
Modify/etc/sysconfig/network
<6> Network Command
Ifdowneth0 shut down the network
Ifconfigeth0 Down Network
Ifupeth0 Open Network
Ifconfigeth0 Up Open Network
Servicenetwork Start//Starting Network Service
Servicenetwork stop//Stops Network Service
Servicenetwork Restart//Restart network services
Servicenetwork Status//view Network Service status
Annex 2:3 Ways to configure your network:
1. Log in as root, run Setup to configure the network, this can be IP, subnet mask, DNS settings. After the configuration is not effective, run/etc/rc.d/init.d/networkrestart Restart the network card will not take effect.
2.ifconfigeth0 x.x.x.x Sets the network adapter Ifconfigeth0 network x.x.x.x the subnet mask. This setting will take effect immediately, but temporarily.
3. Modify/etc/sysconfig/network-scripts/ifcfg-eth0
Files are configured. Does not take effect immediately and requires the network card to be restarted to take effect. Run/etc/rc.d/init.d/networkrestart
Enable NetworkManager Service
First, we will set up your CentOS system to automatically enable NetworkManager on power-on. You can do this:
Chkconfignetworkmanager on
Then we will guide it so that we can apply it without rebooting:
Servicenetworkmanager start
You are in the image environment (GNOME) to complete this step, your notification local (generally in the Gnome panel in the upper right corner) will display a new icon. If you click on this icon, you will see a list of all the wireless networks that can be connected.
You may want to stop using your network and wpa_supplicant services while powering up, because NetworkManager will handle them for you. If so, you only need to perform:
Chkconfignetwork off
Chkconfigwpa_supplicant off
When you start NetworkManager, you can link to a wireless network. You can configure the wireless network card via Iwconfig.