Ubuntu12.04 Network Configuration

Source: Internet
Author: User

1. Configure/etc/Network/interfaces

# Static IP address 1 auto LO 2 iface lo Inet loopback # loopback virtual network device, allow TCP/IP IP address 127.0.0.1 to access your computer 3 # the primary network interface 4 auto eth0 5 iface eth0 Inet static # configure static IP address 6 address 10.112.18.106 # IP address 7 # network 10.112.18.0 8 netmask 255.255.255.0 # subnet mask 9 # broadcast 10.112.18.255 10 gateway 10.112.18.254 # gateway 11 DNS-nameservers 10.112.18.1 # DNS Server
Auto eth1 # continue to add the second Eni, which is the same as the above
..........
# DHCP Dynamic IP address 1 auto LO 2 iface lo Inet loopback 3 # the primary network interface 4 auto eth0 5 iface eth0 Inet DHCP

2. Restart the network. The configuration takes effect.

sudo /etc/init.d/networking restart 

3. Common Network Information viewing commands

Ifconfig # lists information about each network adapter. You can find the corresponding MAC address, IP address, and subnet mask in the network adapter (usually eth0) in use.

Sudo netstat-atnp # view the current network connection status and program

3. Modify the MAC address

1 sudo ifconfig eth0 down # disable Nic 2 sudo ifconfig eth0 HW ether 00: AA: BB: CC: DD: ee # change the address 3 sudo ifconfig eth0 up # Then start Nic

Permanent modification

 sudo vim /etc/init.d/rc.local

Add the preceding three lines of commands.

4. Host Name

1 sudo/bin/hostname # view host name 2 sudo/bin/hostname newname # Set the Host Name of the current host

5. Network Manager (the network configuration tool provided by UBUNTU)

If you have not installed sudo apt-Get install network manager first

 

====================================== Solutions to some problems ================ ========================

1. Invalid DNS Configuration

1 apt-Get install resolvconf # Check whether resolvconf2 dpkg-reconfigure resolvconf is installed # reconfigure resolvconf. Select Yes in the confirmation box.

Then restart and solve the problem.

2.

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.