In Linux, configure a static IP address to access the Internet-Linux general technology-Linux technology and application information. For more information, see the following. 1. Configure the NIC
PCI can be automatically detected. I will not talk about how to load the driver, but how to configure the IP address directly.
Vi/etc/sysconfig/network, modify according to your situation
DEVICE = eth0 <-- DEVICE
ONBOOT = yes <-- whether to start automatically
BOOTPROTO = static <-- whether to use a static IP Address
IPADDR = xxx. xx <-- your IP address
NETMASK = your subnet mask <-- your subnet mask
GATEWAY = 218.99.1.17 <-- your GATEWAY
2 configure dns resolution
Echo "nameserver 211.98.1.28">/etc/resolv. conf
3. Start the network
/Etc/init. d/network restart
4 Test
Ping www.sina.com. cm
64 bytes from 202.106.184.200: icmp_seq = 0 ttl = 249 time = 1.881 msec
64 bytes from 202.106.184.200: icmp_seq = 0 ttl = 249 time = 1.881 msec
64 bytes from 202.106.184.200: icmp_seq = 0 ttl = 249 time = 1.881 msec
64 bytes from 202.106.184.200: icmp_seq = 0 ttl = 249 time = 1.881 msec
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