Linux Network card Configuration detailed

Source: Internet
Author: User
Tags nameserver

The following values are common in all basic configuration files:

* Device=name, where name is the name of the physical device (except for dynamically assigned PPP devices)

Its name is "logical name."

* Ipaddr=addr, here addr is the IP address.

* Netmask=mask, here Mask is a netmask.

* 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 take one of the following values:

o Yes-this device will be activated at boot time.

o No-this device is not activated when boot.

* Userctl=answer, here answer take one of the following values:

o Yes-a non-root user can control the device.

o No-the device is not allowed to be controlled by a non-root user.

* Bootproto=proto, here Proto take one of the following values:

o None--does not use the boot-time protocol.

o BOOTP-use BOOTP protocol.

o DHCP-use DHCP protocol.

Terminal: Query IP address: ifconfig-a

To modify the LAN IP:

1. Log in as Root

2. Modify the configuration file

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

The contents of the document are 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-> modified 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, modify IP

First, 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.128

gateway=219.136.241.254

Second, modify the gateway

Vi/etc/sysconfig/network

Networking=yes

Hostname=aaron

gateway=192.168.1.1

Third, modify DNS

[Aeolus@db1 etc]$ VI resolv.conf

NameServer 202.96.128.68

NameServer 219.136.241.206

Four, restart network configuration

/etc/init.d/network restart

Modify IP Address

Immediate effect:

# ifconfig eth0 192.168.0.20 netmask 255.255.255.0

Start in effect:

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

Modify the default gateway

Immediate effect:

# route add default GW 192.168.0.254

Start in effect:

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

Modify DNS

Modify/etc/resolv.conf

Can be effective immediately after modification

Modify Host Name

Immediate effect:

# hostname FC2

Start in effect:

Modify/etc/sysconfig/network

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.