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 configure IP on the Internet of Centos virtual machine

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces "how to configure IP on the Internet of Centos virtual machine". In daily operation, I believe many people have doubts about how to configure IP on the Internet of Centos virtual machine. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubt of "how to configure IP on the Internet of Centos virtual machine." Next, please follow the editor to study!

If only the virtual machine needs to surf the Internet, it is very simple.

1. Enter the centos system and view the network configuration.

Enter the command: ifconfig-a

two。 Enter the ifcfg-eth0 file.

Enter command: vim / etc/sysconfig/network-scripts/ifcfg-eth0

Note: sudo is required for non-root accounts, otherwise there is no permission to edit, or su can be directly switched to root users.

3. Configure dynamic ip.

Configure ifcfg-eth0 address by modifying ip content

Change onboot=no to onboot=yes to activate the network card.

4. Restart the network service to view the dynamic ip configuration results.

Enter command: service network restart (restart network service)

Note: root users will still be used

If the virtual machine and host are to communicate with each other, you need to configure bridging mode

1. Stop the virtual machine, virtualbox- > General-> Network

Change the connection mode of network card 1 to: bridge network card

two。 Enter the ifcfg-eth0 file.

Enter command: vim / etc/sysconfig/network-scripts/ifcfg-eth0

Note: sudo is required for non-root accounts, otherwise there is no permission to edit, or su can be directly switched to root users.

3. Configure static ip

Ipaddr=192.168.1.10 sets the ip address of the virtual machine to be on the same network segment as the host, but the name cannot be repeated.

Netmask=255.255.255.0 sets subnet mask

Gateway=192.168.1.1 Settings Gateway

Dns1=140.207.198.6 sets dns (same as host)

Defroute=yes

4. Restart the network service to view the dynamic ip configuration results.

Enter command: service network restart (restart network service)

Note: root users will still be used

At this point, the study on "how to configure IP on the Internet of Centos virtual machines" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

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

Internet Technology

Wechat

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

12
Report