Linux Network configuration

Source: Internet
Author: User

First, Shell mode


1. Configure the IP address of the eth0 and activate the device at the same time

sudo ifconfig 192.168. 1.10 255.255. 255.0 up

This command fails after a reboot

2. Add Default gateway

sudo 192.168. 1.1

3. Configure DNS

sudo vi /etc/202.96. 134.133  202.96. 128.68  202.96. 128.166

4. Other commands

ifconfig eth0 up    #激活设备 ifconfig eth0 down    #禁用设备

second, the way to modify the file


Network configuration related files in the/etc/sysconfig/network-scripts/ifcfg-eth0 directory


Where Ifcfg-lo is the default profile for the local network card, Ifcfg-eth0 is the profile for the eth0 NIC.
View Ifcfg-eth0:

Cat /etc/sysconfig/network-scripts/ifcfg-eth0


To configure the Ifcfg-eth0 file:

VI /etc/sysconfig/network-scripts/ifcfg-eth0


In the Ifcfg-eth0 file:

Device: Physical Device Name

Type: Configure the file interface types. There are various network configuration files in the/etc/sysconfig/network-scripts/directory, such as Ethernet, IPSec and so on, the network interface type is Ethernet

UUID: Globally unique identifier, which only takes effect within the system

Onboot: Whether the device is activated at boot time, whether it is powered on or not

Nm_controled: Whether the device can be hosted by the Network Manager graphical management tool

Bootproto: The device uses the No/manual DHCP/BOOTP/DHCP protocol

Hwaddr:mac Address

Ipaddr:ip Address

PREFIX: Subnet mask bits, typically 24-bit, both 255.255.255.0

Gateway: Gateways Address

Defroute: is set as the default route

Ipv4_failure_fatal: If the IPV4 is not successfully activated, the entire device fails in the case of both IPV4 and IPV6 settings

Ipv6init: Whether to enable IPV6

Name: Names of network interfaces

NETMASK: Subnet Mask

DNS2:

DNS1:

Userctl: Whether to allow non-root users to control the device

Third, GUI mode


Access to the Network Manager Graphics management tool

System-config-network

Linux Network configuration

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.