(Linux) centos/suse Modify network Settings __linux

Source: Internet
Author: User
Tags centos

CentOS to modify the network to modify a few files

1,/etc/sysconfig/network CentOS set host name and network configuration

For example:

Networking=yes
Hostname=oel6-69.localdomain
2,/etc/sysconfig/network-scripts/ifcfg-eth0 for the specific network card settings

For example:

Device= "Eth0"
bootproto= "Static"
ipaddr=192.168.9.69
netmask=255.255.255.0
Hwaddr= "08:00:27:43:d4:a8"
Nm_controlled= "Yes"
onboot= "Yes"
gateway=192.168.9.88
3,/etc/resolv.conf set DNS

Like NameServer XXX.
4,/etc/hosts set the specified domain name resolution address

Then restart Service Network restart


However, the command does not work when the restart service is in effect, and some environment variables need to be configured at this time

Su enters root and runs vi/etc/profile to add the following statement at the end of the file: Export path= $PATH:/sbin

#针对root用户, append the/sbin directory after the path variable, set the variable to global save and exit.

Modify/home/user/.bash_profile, add/sbin:/usr/sbin:/usr/local/sbin:/usr/kerberos/sbin after path this is for account development, such as Oracle, etc.

After the change is complete, execute the command:. . bash_profile, if you do not have Execute permissions chmod 5755 user files, then execute


Note: If it is SuSE, the static IP need to set the gateway,/etc/sysconfig/network/routes add default 192.168.XXX. Xxx


With some query commands

1, query network card IP, mask and other information

Ifconfig-a

2. Query Gateway

IP route Show or Netstat-rn

3, query DNS

Cat/etc/resolv.cong

Related Article

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.