RedHat: set ip, gateway, and DNS

Source: Internet
Author: User

1. Modify the IP address

Vim/etc/sysconfig/network-script/ifcfg-eth0
Device = eth0
Bootproto = static --- static or dynamic
Broadcast = 192.168.1.255
Ipaddr = 192.168.1.35 --- IP Address
Netmask = 255.255.255.0 --- Subnet Mask
Network = 192.168.1.0 --- network ID
Onboot = Yes Gateway:

 

2. Modify the Gateway

Edit/etc/sysconfig/Network
Networking = Yes
Hostname = vmlinux --- Host Name
Gateway = 192.168.1.2 --- gateway DNS:

 

3. Modify DNS


Edit/etc/resolv. conf
Nameserver 202.103.224.68

 

 

4. Modify Nic Mac

1. First, you must disable the NIC device. Otherwise, the system is reported to be busy and cannot be changed.
Command:/sbin/ifconfig eth0 down

2. Modify the MAC address.
Command:/sbin/ifconfig eth0 HW ether 00 aa bb cc dd EE

3. Enable Nic again
Command:/sbin/ifconfig eth0 up

 

The MAC address of the NIC is changed.

Another method is to modify the configuration file ifcfg-ethx of the NIC and add a similar format MAC address: hwaddr = 00: AA: BB: CC: DD: EE.

Linux Command: ifconfig Function Description: displays or sets network devices

Syntax: ifconfig [network device] [down up-allmulti-ARP-promisc] [add <address>] [del <address>] [

Note: ifconfig can be used to set the status of network devices or display the current settings. In this way, you have successfully changed the IP address, gateway, DNS, and MAC address of RedHat Enterprise Edition.

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.