Ubuntu10.10 Network Configuration

Source: Internet
Author: User

Ubuntu10.10 Network Configuration

For a while, I was really confused about the network configuration of ubuntu. I tried to find it on the Internet. I was a little careful.

Let's talk about the general configuration process first, and then go into some details.

I. configuration is divided into three categories: configuration through the configuration file, command configuration, and graphical network connection menu configuration.

Unlimited labs such as dial-up wireless are not involved.

Main file:/etc/Network/interfaces. Here are some configurations of IP address, gateway, mask, etc;/etc/resolv. conf this file stores DNS information

Main Command: restart the network with sudo/etc/init. d/networking restart to invalidate the configuration file; add default GW in sudo route <IP address> to set the gateway.

Ii. configuration method

1. Configure through commands

If you only want to temporarily modify the IP address, you can choose this method. After the network is restarted, it will be lost.

1) sudo ifconfig eth0 <IP address> netmask <subnet mask> up

Eth0 is the network card. The last "up" indicates that the NIC is enabled and can be left empty.

2) sudo route add default GW <gateway IP address>

Set Gateway
3) set DNS, which must be modified in the configuration file.

4) configure the Host Name

Command: sudo/bin/hostname <Host Name>
However, when the system starts, the host name is read from/etc/hostname.

2. Configure through the configuration file

1) configure the IP Gateway: add it to sudo gedit/etc/Network/interfaces

DHCP:

 
Auto Lo
Iface lo Inet loopback

Auto eth0
Iface eth0 Inet DHCP
Static IP:
 
Auto Lo
Iface lo Inet loopback
# The above is the loop
# Nic eth0 Configuration
Auto eth0
# Staic static IP
Iface eth0 Inet static
Address 192.168.1.5
Netmask 255.255.255.0
Gateway 192.168.1.1
# Network 192.168.3.0
# Broadcast 192.168.3.255
# The following two are the network number and broadcast number, which can be calculated by other information, so you do not need to set

The second IP address (virtual IP address) can also be configured here)

Auto eth0: 1
Iface eth0: 1 Inet static
Address 192.168.1.60
Netmask 255.255.255.0
# Network x. x
# Broadcast x. x
Gateway x. x

2) Configure DNS: sudo gedit/etc/resolv. conf

 
Nameserver 202.107.117.11

3) Host Name: Enter the host name in sudo gedit/etc/hostname. By default, a host name is provided, so this is not required.

4) restart the network: sudo/etc/init. d/networking restart

You can also restart the NIC:

 
Sudo ifconfig eth0 down
Sudo ifconfig eth0 up

Restarting the NIC does not affect other NICs. We recommend that you restart the NIC.

3. graphical network connection menu Configuration

This is also called network manager in system-preferences. You can use the network management Applet in the upper right corner to enable its configuration.

This is a problem: it shares the configuration file with the second method, which may lead to various conflicts.

As a result, both methods are configured, sudo/etc/init. d/networking restart enables the second method of configuration, and click auto eth0 in the network management applet on the desktop panel to enable the third method.

Iii. Unsolved Problems

1. How can I retrieve the lost network management applet on the desktop panel?

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.