In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains the "Ubuntu IP system configuration file use command to set the address method", the content of the article is simple and clear, easy to learn and understand, the following please follow the editor's train of thought slowly in depth, together to study and learn "Ubuntu IP system configuration file use command to set address method" bar!
Use the command to set the Ubuntu IP address
1. Modify the configuration file blacklist.conf to disable IPV6:sudo vi / etc/modprobe.d/blacklist.conf
two。 Add blacklist ipv6 to the document *, and then view the modification result: cat / etc/modprobe.d/blacklist.conf
3. Set Ubuntu IP (set the IP address and subnet mask of the network card eth0) sudo ifconfig eth0 192.168.2.1 netmask 255.255.255.0
4.Ubuntu IP setup Gateway sudo route add default gw 192.168.2.254
5.Ubuntu IP sets DNS to modify / etc/resolv.conf, in which address 1 of nameserver DNS and address 2 of nameserver DNS are added.
6. Restart the network service (if not, restart ubuntu:sudo reboot): sudo / etc/init.d/networking restart
7. View current Ubuntu IP:ifconfig
Modify the Ubuntu IP system configuration file directly
The network configuration file of Ubuntu IP is: after / etc/network/interfaces is opened, 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.2.1 gateway 192.168.2.254 netmask 255.255.255.0 # network 192.168.2.0 # broadcast 192.168.2.255
Change the above Ubuntu IP address and other information to yourself. Use the following command to make the network settings take effect:
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 x.x.x.x netmask x.x.x.x 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.
5. Configure DNS
First of all, you can add some host names and 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 the / etc/resolv.conf file. Assuming that the IP address of the DNS server is 192.168.2.2, the content of the / etc/resolv.conf file should be:
Search chotim.com
Nameserver 192.168.2.2
6. Manually restart network services: sudo / etc/init.d/networking restart
The returned result is as follows:
* Reconfiguring network interfaces... [OK]
Thank you for your reading, the above is the content of "Ubuntu IP system configuration file uses commands to set addresses". After the study of this article, I believe you have a deeper understanding of the problem of Ubuntu IP system configuration files using commands to set addresses, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.