Ubuntu configuration ETH NIC, fixed IP address

Source: Internet
Author: User
Tags nameserver

Ubuntu configuration ETH nic, fixed IP address

1, modify the configuration file/etc/network/interfaces [email protected]: ~# sudo gedit/etc/network/interfaces

Add the following: auto eth0 #设置自动启动eth0接口iface eth0 inet static #配置静态IP address 192.168. 11.88 #IP地址netmask 255.255.255.0 #子网掩码Gateway 192.168.11.1 #默认网关

2. Modify DNS sudo gedit/etc/resolve.conf

nameserver 127.0.0.1 #记得加上nameserver 8.8.8.8 #当地dns服务器 (view local DNS with Ipconfig/all, first DNS is default, Total 2 DNS)

Note: #后面的注释信息不要加进去.

3. Restart the network for the configuration to take effect sudo/etc/init.d/networking restart

4. See if IP is configured successfully[email protected]: ~# ifconfig eth0 Link encap:ethernet HWaddr 00:0c:29:2d:89:40 inet Addr:192.168.11.88bcast:192.168.11.255  mask:255.255.255.0           Inet6 Addr: FE80::20C:29FF:FE2D:8940/64 Scope:link           up broadcast RUNNING multicast  mtu:1500  metric:1           RX packets:223 errors : 0 dropped:0 overruns:0 frame:0           TX packets:253 errors:0 dropped : 0 overruns:0 carrier:0           collisions:0 txqueuelen:1000            RX bytes:24219 (24.2 KB)   TX bytes:22960 (22.9 KB)   & nbsp;       interrupt:19 Base address:0x2024

Lo Link encap:local Loopback inet addr:127.0.0.1 mask:255.0.0.0 inet6 addr::: 1/128 Scope:hos           T up LOOPBACK RUNNING mtu:16436 metric:1 RX packets:48 errors:0 dropped:0 overruns:0 frame:0           TX packets:48 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:3964 (3.9 kb) TX bytes:3964 (3.9 kb)

[email protected]: ~#

Note: The red word bold "192.168.11.88" is the same as the IP configured above, indicating that the IP configuration was successful.

If your network is not starting or unstable, try the following:

Gedit/etc/networkmanager/networkmanager.conf

Managed=false set into Managed=true

I'm using a virtual machine to bridge the NIC to a fixed IP address that communicates between the local virtual machines

Ubuntu configuration ETH NIC, fixed IP address

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.