Ubuntu 12.04 Network Settings, custom IP address

Source: Internet
Author: User
Tags nameserver

1, server version

Set IP address

Ubuntu 12.04 's network settings file is/etc/network/interfaces, open the file and you will see

Auto lo
iface lo inet loopback

The setting here is the local loop. Add in the back

Auto eth0
iface eth0 inet static
address 192.168.1.230 (IP)
netmask 255.255.255.0 (subnet mask)
Gateway 192.168.1.1 (Gateway)

Eth0 is the computer network card, if the computer has more than one network card, such as there will be eth1, can be set up here. Iface eth0 inet set to DHCP is dynamically acquiring IP, set to static with a custom IP. Here to customize the IP address, so select the static option.

Restart Network Services

sudo/etc/init.d/networking restart

Restart good, with ifconfig look down eth0, is not changed to their own needs of the IP address.

Setting up DNS

IP settings, if the direct ping www.baidu.com will find ping impassability, because DNS has not been set up, edit/etc/resolv.conf, plus the DNS server address.

NameServer 8.8.8.8
nameserver 8.8.4.4

These two are the IP addresses of the free DNS servers provided by Google.

Ps1:ping hint, connect:network is unreachable, mostly gateway problem

sudo route add default GW 192.168.1.1

ps2:ping hint,ping: Unknown host baidu.com

Vi/etc/resolv.conf
#增加以下两行, specific IP please fill in the actual

NameServer 192.168.1.1

2, desktop version

The Desktop Edition provides Network-manage management tools that can be managed directly through the interface.

Click on the top right corner of the network icon, edit the connection, add new connections. My settings screenshot as follows, you can make changes according to your needs.

Ubuntu 12.04 Desktop Network Settings-Select the network card

Ubuntu 12.04 Desktop Network Settings-set IP http://www.01happy.com/ubuntu-12-04-network-setting/

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.