Ubuntu's network configuration

Source: Internet
Author: User

1, install vim full version, Ubuntu installed by default is vim tiny version:

$sudo apt-get Remove Vim-common
$sudo apt-get Install vim  //In order to prevent the BACKSPACE key, the arrow keys in the VI edit mode failure

2, modify the/etc/network/interfaces of Ubuntu

The default contents of the file are as follows:

Auto lo
iface lo inet loopback

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

3. Edit/etc/resolv.conf File

NameServer 202.99.166.4

4, restart the network

$CD/etc/init.d/
$sudo./networking restart

5, if not restarted successfully, the Edit command has the following results

$ DMESG | Grep-i ETH

[    3.050064] e1000 0000:02:01.0 eth0: (pci:66mhz:32-bit) 00:0c:29:05:a3:e2
[    3.050074] e1000 0000:02:01.0 Eth0:intel (R) pro/1000 network Connection
[    3.057410] e1000 0000:02:01.0-ens33:renamed from E Th0

6. Operate the following steps:

$ sudo nano/etc/default/grub

 modify grub_cmdline_linux= "net.ifnames=0 biosdevname=0"

//DHCP mode without having to operate the following steps.

$ sudo grub-mkconfig-o/boot/grub/grub.cfg

auto eth0
iface eth0 inet static address
           192.168.12.12< C12/>netmask 255.255.255.0
           dns-nameservers 192.168.12.2
           Gateway 192.168.12.2

$ sudo reboot

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.