How to modify IP address, Gateway, and DNS in Linux command line

Source: Internet
Author: User
This article describes how to modify the IP address, Gateway, and DNS of a Linux command line. Change the Nic eth0IP to 10216801ifconfigeth010216801netmask2552552550

This article describes how to modify the IP address, Gateway, and DNS of a Linux command line.

Nic eth0 IP address changed to 102.160.1

Ifconfig eth0 102.160.1 netmask 255.255.255.0

Change gateway to 102.160.254

Route add default gw 102.160.254

Linux command line dns modification

Echo "nameserver 202.202.202.20">/etc/resolv. conf

Restart network service

/Etc/rc. d/init. d/network restrart

Attach an optical drive to a Linux command line

1. create a cdrom directory under the mnt Directory

Cd/mnt

Mkdir cdrom

2. mount the optical drive on the Linux command line

Mount-t iso9660/dev/cdrom/mnt/cdrom

3. unmount the optical drive using the Linux command line

Umount/mnt/cdrom

The above is the Linux command line to modify the IP address, Gateway, DNS method.

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.