Set a fixed IP address for the NIC in RedHatlinux (bind two IP addresses)

Source: Internet
Author: User
In RedHatlinux, after installing the linux system, set a fixed IP address for the NIC (bound to two IP addresses), and then configure the nic ip address in command mode. The configuration file is usually/etc/sysconfig/network-scripts/ifcfg-interface-namewww.2cto.com1. configure the nic ip address vi/et...
In Red Hat linux, after installing the linux system, set a fixed IP address for the NIC (two IP addresses are bound), and then configure the nic ip address in command mode. The configuration file is usually/etc/sysconfig/network-scripts/ifcfg-interface-name www.2cto.com 1. configure the nic ip address vi/etc/sysconfig/network-scripts/ifcfg-eth0 # Second Nic: vi/etc/sysconfig/network-scripts/ifcfg-eth1DEVICE = eth0 # physical device name IPADDR = 192.168.1.10 # IP address NETMASK = 255.255.255.0 # mask value NETWORK = 192.168.1.0 # network address (optional) BROADCAST = 192.168.1.255 # BROADCAST address (optional) GATEWAY = 192.168.1.1 # GATEWAY address ONBOOT = yes # [yes | no] (whether to activate the device during boot) USERCTL = no # [yes | no] (is it controllable for non-root users? BOOTPROTO = static # [none | static | bootp | dhcp] (Protocol not used during boot | static allocation | BOOTP protocol | DHCP protocol) 2. configure the Nic DNS configuration file in/etc/resolv. conf. Vi/etc/resolv. confnameserver 202.109.14.5 # master DNSnameserver 219.141.136.10 # After DNSsearch localdomain is configured, you must restart the network service: service network restart or/etc/init. d/network restart3. a single NIC is bound to two IP address www.2cto.com. The network device configuration file of linux is stored in/etc/sysconfig/network-scripts. for the first Ethernet network device, the configuration file name is typically a ifcfg-eth0. To bind one more IP address to the first network device, create a file named ifcfg-eth0: 0 in the/etc/sysconfig/network-scripts directory, as shown in the following example: DEVICE = "eth0: 0" IPADDR = "211.100.10.119" NETMASK = "255.255.255.0" ONBOOT = "yes" where DEVICE is the DEVICE name and IPADDR is the IP address of the DEVICE, NETMASK is a subnet mask, and ONBOOT indicates that it is automatically started when the system starts. If you need to bind another IP address, you only need to add one of the file name and the eth0 in the DEVICE in the file. LINUX supports up to 255 IP aliases.
 
Related Article

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.