Ubuntu12.04 static IP Address Setting Method

Source: Internet
Author: User
After the computer was moved to the lab, the lab had many problems due to campus network. The first problem is the Ubuntu update source, which must be changed. Otherwise, the update will fail. The second is the remote login problem of Securecrt. If the windows host and ubuntu virtual machine can communicate, they must be on the same network segment, while ubuntu is dynamically loaded and must be manually changed to the same network segment. There are many ways to change the web site on the Internet. After verification, the following methods are the best: 1. Configure static IP address $ sudo

After the computer was moved to the lab, the lab had many problems due to campus network.

The first problem is the Ubuntu update source, which must be changed. Otherwise, the update will fail.

The second is the remote login problem of Securecrt. If the windows host and ubuntu virtual machine can communicate, they must be on the same network segment, while ubuntu is dynamically loaded and must be manually changed to the same network segment. There are many ways to change the website on the internet. After verification, the following methods are the best:

1. Configure static IP addresses

$ Sudo vi/etc/network/interfaces

The original content contains only the following two lines:

Auto lo

Iface lo inet loopback

Append the following content to the end:

Auto eth0

Iface eth0 inet static

Address 192.168.0.33

Gateway 192.168.0.1

Netmask 255.255.255.0

Network 192.168.0.0

Broadcast 192.168.0.255

Save and exit;

2. manually configure dns

$ Sudo vi/etc/resolv. conf

Add the following content to the end:

Nameserver 192.168.0.10

Save and exit.

3. Restart the network to make the change take effect.

$ Sudo/etc/init. d/networking restart

There is a problem here, that is, after ubuntu is restarted, it finds that the Internet is no longer available. The problem lies in/etc/resolv. conf. After the file is restarted, the dns configured in this file is automatically changed to the default value. Therefore, you need to modify DNS permanently. The method is as follows:

Cd/etc/resolvconf/resolv. conf. d/

# Cat base

Nameserver 8.8.8.8

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.