Comparison of Redhat and Ubuntu Nic settings

Source: Internet
Author: User
In RedHatlinux, if you set the fixed ip address of the NIC in redhat-config-network under xwindow, the setting of the fixed ip address of the NIC does not work. If you set it, the ping will fail. Check some information, change/etc/sysconfig/network-scripts/ifcfg-eth0 (the first Nic is eth0), configure the dns file as/etc/resolv. conf, I keep the dhcp configuration. After configuration, use ifco RedHat linux to set a fixed ip address for the NIC.
Previously, the redhat-config-network Setting of the NIC fixed ip address in xwindow did not work. After the redhat-config-network is set, the ping fails. Check some information, change/etc/sysconfig/network-scripts/ifcfg-eth0 (the first Nic is eth0), configure the dns file as/etc/resolv. conf, I keep the dhcp configuration. After configuration, use ifconfig eth0 down; ifconfig eth0 up. The following is a configuration file list:

#/Etc/sysconfig/network-scripts/ifcfg-eth0:

DEVICE = eth0

BOOTPROTO = static

BROADCAST = 192.168.1.255

IPADDR = 192.168.1.10

NETMASK = 255.255.255.0

NETWORK = 192.168.1.0

HWADDR = 52: 54: AB: 2F: CF: F0

GATEWAY = 192.168.1.1

ONBOOT = on

TYPE = Ethernet

#/Etc/resolv. conf

Nameserver 202.109.14.5

Nameserver 202.96.209.5

Search localdomain

Or run the following command: setup

Or:

Route add-net 192.168.1.50 netmask 255.255.255.0 dev eth0

Or:

Ifconfig eth0 192.168.1.50 netmask 255.255.255.0

Ubuntu Nic settings, ip, mask, gateway, dns
Sudo vi/etc/network/interfaces

// This should determine whether to enable this port

Auto eth0

// Set the IP address statically

Iface eth0 inet static

Address 172.16.146.200

Netmask 255.255.255.0

# Broadcast 172.16.146.255

Gateway 172.16.146.254

// Dynamic settings through dhcp

Iface eth0 inet dhcp

// Set the DNS server

Sudo vi/etc/resolv. conf

Nameserver 202.96.128.68

Nameserver 61.144.56.101

Nameserver 192.168.8.220

// Reset the network to enable the new settings

Sudo/etc/init. d/networking restart

// OK

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.