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 parse the static Ubuntu IP address of Nic configuration

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

Share

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

This article mainly shows you "how to resolve the network card configuration static Ubuntu IP address", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "how to resolve the network card configuration static Ubuntu IP address" this article.

Ubuntu IP after a long period of development, here I would like to publish a personal understanding, here is to talk about the Ubuntu IP address. A machine in the unit is completely installed with Ubuntu Server, but you can only VM one on XP when you go home. When you install it, the network card is DHCP. Use ifconfig to check that the Ubuntu IP address is 192.168.92.128, and you can ping.

Reprinting is not wrong:

Ubuntu IP address Command Line modify Network configuration method / etc/network/interfaces

After opening it, you can set DHCP or manually set static ip. Front auto eth0, let the network card boot and mount automatically.

1. Configure the network card in DHCP mode

Edit the file / etc/network/interfaces:

Sudo vi / etc/network/interfaces

And replace the line about eth0 with the following line:

# The primary network interface-use DHCP to find our address

Auto eth0

Iface eth0 inet dhcp

Use the following command to make the network settings take effect:

Sudo / etc/init.d/networking restart

You can also enter the following command directly from the command line to get the address sudo dhclient eth0

two。 Configure a static Ubuntu IP address for the network card

Edit the file / etc/network/interfaces:sudo vi / etc/network/interfaces

And replace the line about eth0 with the following line: # The primary network interface

Auto eth0

Iface eth0 inet static

Address 192.168.3.90

Gateway 192.168.3.1

Netmask 255.255.255.0

# network 192.168.3.0

# broadcast 192.168.3.255

Change the above Ubuntu IP address and other information to yourself. Use the following command to make the network settings effective: sudo / etc/init.d/networking restart

3. Set the second Ubuntu IP address (virtual IP address)

Edit the file / etc/network/interfaces:sudo vi / etc/network/interfaces

Add the following line to the file:

Auto eth0:1

Iface eth0:1 inet static

Address 192.168.1.60

Netmask 255.255.255.0

Network x.x.x.x

Broadcast x.x.x.x

Gateway x.x.x.x

Fill in all the information such as address,netmask,network,broadcast and gateways according to your situation.

Use the following command to make the network settings effective: sudo / etc/init.d/networking restart

4. Set host name (hostname)

Use the following command to view the host name of the current host: sudo / bin/hostname

Use the following command to set the host name of the current host: sudo / bin/hostname newname

When the system boots, it reads the name of the host from / etc/hostname. For more information about setting the host name, please visit here

5. Configure DNS

First, you can add some host names and Ubuntu IP addresses corresponding to these host names in / etc/hosts, which is a simple native static query. To access the DNS server for query, you need to set up the / etc/resolv.conf file. Assuming that the Ubuntu IP address of the DNS server is 192.168.3.2, the content of the / etc/resolv.conf file should be: search test.com

The above is all the contents of the article "how to resolve the static Ubuntu IP address of network card configuration". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

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