How to modify IP address, gateway, and DNS in Linux Command Line

Source: Internet
Author: User

How to modify IP address, gateway, and DNS in Linux Command Line

This article will briefly describe how to use Linux Command lines to modify IP addresses, gateways, and DNS.

Change the IP address of eth0 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 command

Service network restart # or/etc/rc. d/init. d/network restrart

Articles you may be interested in
  • Mysql command to change the table structure: add, delete, modify fields, adjust the field order
  • Run commands on the Linux background (run without hanging up)
  • How to run php files in the command line in windows
  • Yii database addition, modification, and deletion operations Summary
  • Linux Command file directory management cat command
  • Linux File Content statistics command wc command usage details
  • How does one modify the default homepage of a website through. htaccess?
  • Graphic tutorial on common basic commands in Unix/Linux

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.