Linux Network Configuration

Source: Internet
Author: User

Command:

 

IP address, subnet mask, Gateway

Ifconfig eth0 192.168.0.123 netmask 255.255.255.0

Route add default GW 192.168.0.1

 

DNS

VI/etc/resolv. conf

Add nameserver 202.106.0.20

 

This configuration does not take effect immediately and must be restarted.

/Etc/init. d/network restart

 

File:

 

The above configuration fails after restart, you can change/etc/sysconfig/network-scripts/ifcfg-eth0 (here you want to configure the interface for eth0, if there is no such file then add)

 

Device = eth0
Hwaddr = 00: 1D: 72: 98: 43: DC
Onboot = Yes
Bootproto = none
Netmask = 255.255.255.0
Ipaddr = 10.47.34.123
Userctl = Yes
Peerdns = Yes
Ipv6init = No
Nm_controlled = No
Gateway = 10.47.34.1
Type = Ethernet

 

 

Ifconfig:

Ifconfig <interface> up to activate the device

Down Device not activated

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.