Linux Learning (2015-1)

Source: Internet
Author: User
Tags domain name server

1, the role of Linux eth0 and eth1

Configure the network environment under Unbuntu:

1. The default content of the/etc/network/interfaces file that opens Ubuntu is as follows:

Auto Lo

Iface Lo inet Loopback (These two sentences can be reserved)

Dynamically acquired configuration methods:

Auto Eth0

Iface eth0 inet DHCP

Statically allocated configuration methods:

Auto Eth0

Iface eth0 inet Static

Address 192.168.0.1

netmask 255.255.255.0

Gateway 192.168.0.1

Modify the configuration file to save according to the configuration requirements (whether it is dynamically allocated or obtained automatically).

2. Add a domain Name server: Open/etc/resolv.conf file

Add this line: NameServer 202.99.166.4

3. Restart the network

$/etc/init.d/networking Restart (This command is to restart the NIC)

Or

$ifdown eth0

$ifup eth0 (These two commands are targeted to restart a network interface because a system may have multiple network interfaces)

4. See if the parameters of the network configuration are correct (you can see if the network configuration is modified for each operation)

$ifconfig

5. See if you can ping through

Ping does not pass the gateway indicates a problem with the network configuration ping domain name Description DNS problem

There are times when you need to modify the hardware address of the NIC:

Method One:

$ifconfig eth0 hw ether XX:XX:XX:XX:XX:XX

$/etc/init.d/networking Restart (restart NIC)

Method Two:

The above is only a temporary modification of the hardware address to permanently modify, directly edit the/etc/network/interfaces file, after iface eth0 inet static Add a line: pre-up ifconfig eth0 hw ether xx:xx:xx : Xx:xx:xx (Mac to change)

$ sudo/etc/init.d/networking Restart (restart NIC)

Linux Learning (2015-1)

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.