Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to modify IP address under linux

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "how to modify IP address under linux". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to change the IP address under linux.

Tools / raw materials

Root user rights

Methods / steps

1. Log in to linux using root user, and open the entry terminal.

2. Enter: vi / etc/sysconfig/network-scripts/ifcfg-eth0 in the terminal

3. After entering the train

Start editing and fill in the ip address, subnet mask, gateway, DNS, etc. Among them, "information in the red box" is necessary.

4. Save and exit after editing

Restart network services

Service network restart or / etc/init.d/network restart

Then the ping gateway and ping external network are tested. All ping means that the network is normal.

5. Detailed summary:

-modify ip address

Effective immediately:

# ifconfig eth0 192.168.1.155 netmask 255.255.255.0

Restart takes effect:

Modify vi / etc/sysconfig/network-scripts/ifcfg-eth0

-modify default gateway

Effective immediately:

# route add default gw 192.168.1.1

Restart takes effect:

Modify vi / etc/sysconfig/network-scripts/ifcfg-eth0

-modify dns

Modify vi / etc/resolv.conf

The modification takes effect immediately, and the restart is also effective.

-modify host name

Effective immediately:

# hostname test1

Restart takes effect:

Modify vi / etc/sysconfig/network

END

Matters needing attention

If you are not familiar with it, practice a few more times.

At this point, I believe you have a deeper understanding of "how to modify the IP address under linux". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report