Ubuntu config and modify IP address

Source: Internet
Author: User

@Ubuntu Configuring and modifying IP addresses

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

Add the following content:
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 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)
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:host
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.

Do not want to modify, is the DHCP mode, direct tapping: [email protected]: ~# ifconfig View current IP

Ubuntu config and modify 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.