Linux Nic configuration details

Source: Internet
Author: User
Tags nameserver
Files: etcsysconfignetwork-scriptsifcfg-eth0 below & amp; 20540; common in all basic profiles

File:/etc/sysconfig/network-scripts/ifcfg-eth0

The following values are common in all basic configuration files:
* DEVICE = name. here, name is the name of the physical DEVICE (except for the dynamically allocated ppp device,
Its name is "logical name ".
* IPADDR = addr. here addr is the IP address.
* NETMASK = mask. here, the mask is the network mask.
* NETWORK = addr. here, addr is the NETWORK address.
* BROADCAST = addr. here, addr is the BROADCAST address.
* GATEWAY = addr. here, addr is the GATEWAY address.
* ONBOOT = answer. here, answer takes one of the following values:
O yes -- the device will be activated during boot.
O no -- this device is not activated during boot.
* USERCTL = answer. here, answer takes one of the following values:
O yes -- non-root users can control the device.
O no -- non-root users are not allowed to control the device.
* BOOTPROTO = proto, where proto takes one of the following values:
O none -- protocol when boot is not used.
O bootp -- use the bootp protocol.
O dhcp-use the dhcp protocol.

Terminal: query IP address: ifconfig-
Modify the lan ip address:
1. log on as root
2. modify the configuration file
/Etc/sysconfig/network-scripts/ifcfg-eth0

The file content is as follows:
\ DEVICE = eth0
HWADDR = 00: 0C: 29: A2: 8C: B2
ONBOOT = yes
TYPE = Ethernet
NETMASK = 255.255.255.0
IPADDR = 192.168.1.11-> Change to 192.168.1.12
GATEWAY = 192.168.1.1

Reboot

Ifconfig eth0 new ip then edit/etc/sysconfig/network-scripts/ifcfg-eth0, modify ip
Ifconfig eth0 New IP

Then edit/etc/sysconfig/network-scrIPts/ifcfg-eth0 and modify the IP

1. modify the IP address

[Aeolus @ db1 network-scrIPts] $ vi ifcfg-eth0

DEVICE = eth0

ONBOOT = yes

BOOTPROTO = static

IPADDR = 219.136.241.211

NETMASK = 255.255.255.255.128

GATEWAY = 219.136.241.254

2. modify the Gateway

Vi/etc/sysconfig/network

NETWORKING = yes

HOSTNAME = Aaron

GATEWAY = 192.168.1.1

3. modify DNS

[Aeolus @ db1 etc] $ vi resolv. conf

Nameserver 202.96.128.68

Nameserver 219.136.241.206


4. restart network configuration

/Etc/init. d/network restart


Modify IP address

Effective immediately:

# Ifconfig eth0 192.168.0.20 netmask 255.255.255.0

Start effective:

Modify/etc/sysconfig/network-scrIPts/ifcfg-eth0

Modify the default gateway

Effective immediately:

# Route add default gw 192.168.0.254

Start effective:

Modify/etc/sysconfig/network-scrIPts/ifcfg-eth0

Modify DNS

Modify/etc/resolv. conf

The modification takes effect immediately and starts as well.

Modify host name

Effective immediately:

# Hostname fc2

Start effective:

Modify/etc/sysconfig/network

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.