Linux Network configuration related

Source: Internet
Author: User

Ubuntu Network configuration file in/etc/network/intrfaces;

SuSE's network configuration is under/etc/sysconfig/network/, one profile per Nic.

Intrfaces The following content means assigning IP using DHCP:
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

Dynamic Host Configuration Protocol (DHCP) is a client/server Protocol this automatically provides an Internet Pr Otocol (IP) host with it IP address and other related configuration information such as the subnet mask and default Gatew Ay.

Modify the following to configure the static IP address:
auto lo
iface lo inet loopback

# The Primary network interface
Auto Eth0
#iface eth0 inet DHCP

iface eth0 inet static
address 192.168.80.129
netmask 255.255.255.0
gateway 192.168.80.2

Note: You only need to set address (IP address), netmask (subnet mask), Gateway (gateways) These three items ok,network and broadcast are not writable.

Setting up a DNS server

Are configured within this file/etc/resolv.conf.

Content:

NameServer 192.168.80.2
NameServer 8.8.8.8

Save exit.

Note: After restarting Ubuntu, it is not possible to surf the internet again, the problem is/etc/resolv.conf. Once restarted, the DNS for this file configuration is automatically modified to the default value. So you need to permanently modify DNS. Here's how:

# Vim/etc/resolvconf/resolv.conf.d/base
NameServer 192.168.80.2
NameServer 8.8.8.8

3. Restart the networking service to make it effective:

#/etc/init.d/networking Restart

This allows the network configuration to be permanently active.

Linux Network configuration related

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.