In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
Today, I will show you how to set up static IP in Linux bridge mode. The content of the article is good. Now I would like to share it with you. Friends who feel in need can understand it. I hope it will be helpful to you. Let's read it along with the editor's ideas.
A lot of articles can be found on the Internet. Generally speaking, in NAT mode, the virtual machine is subordinate to the host, that is, access to the external network must be accessed through the host, so the IP of the virtual machine can only be identified by the host. In the bridge mode, the virtual machine and the host are parallel, share a network card (using multiple interfaces of the network card), and can directly access the external network. Therefore, to remotely access the mysql of a virtual machine, you need to use bridging mode instead of NAT mode. However, the IP in bridging mode generally changes, and to avoid resetting the IP for each remote connection, it is set to static IP.
Step 1: check IP under Linux
The method of setting static IP in Linux Bridge Mode the method of setting static IP in Linux Bridge Mode
I am Ubuntu 16.04. here are two items, the following one is lo (local loopback) can be ignored, the above one needs to be configured. Note that my virtual network card here is ens33, and what I will modify later is ens33. There are many configuration tutorials on the Internet. The name of their Linux system network card is not ens33 (for example, some are eth0).
Step 2, set up the virtual network
In the menu of VMware, Edit-> Virtual Network Editor
The method of setting static IP in Linux Bridge Mode the method of setting static IP in Linux Bridge Mode
Modify the "bridging" in the VMnet message to the network card adapter, which is automatic by default.
Step 3: check the IP information of the host (in this case, windows)
The command is ipconfig / all, and the / all option is added after it to view the description of the network card
The method of setting static IP in Linux Bridge Mode the method of setting static IP in Linux Bridge Mode
Note that the description Qualcomm Atheros here is the same as the name of the network card you just selected in step 2. Remember the three important items of the host.
IPv4 address: 192.168.5.63 Subnet Mask: 255.255.255.0 default Gateway: 192.168.5.1
Step 4: modify the network interface configuration of Linux
$sudo vim / etc/network/interfaces
Modify the file (the specific path varies with the system), and set ens33 to the new IP under the same network segment. Here I set it to 192.168.5.64. (the IP calculation method of the same network segment is that the IP is the same as the subnet mask and. For example, 192.168.5.63 and 255.255.255.0 get 192.168.5.0 from and. For more information, please see the IP section of the computer network textbook.)
The method of setting static IP in Linux Bridge Mode the method of setting static IP in Linux Bridge Mode
Lines 5-10 are edited manually, and you can see that gateway and netmask are the same as on the host, with only address modified.
Step 5: set up DNS
Xyz@ubuntu:~$ sudo vim / etc/resolvconf/resolv.conf.d/head
The method of setting static IP in Linux Bridge Mode the method of setting static IP in Linux Bridge Mode
Then restart the virtual machine network service (this step turned out to be useless, though for some reason, let's honestly restart the system. )
Xyz@ubuntu:~$ sudo / etc/init.d/networking restart
[ok] Restarting networking (via systemctl): networking.service.
Now check to see if the configuration is wrong.
Check IP, which has been changed to 192.168.5.64
The method of setting static IP in Linux Bridge Mode the method of setting static IP in Linux Bridge Mode
Try ping a URL:
The method of setting static IP in Linux Bridge Mode the method of setting static IP in Linux Bridge Mode
Try the host ping virtual machine:
The method of setting static IP in Linux Bridge Mode the method of setting static IP in Linux Bridge Mode
But the virtual machine ping host failed:
The method of setting static IP in Linux Bridge Mode the method of setting static IP in Linux Bridge Mode
The reason is that the host has turned on the firewall and turned off the firewall of the public network.
Once again, the ping host is successful:
The method of setting static IP in Linux Bridge Mode what is Linux system Linux is a free-to-use and free transmission UNIX-like operating system, is a POSIX-based multi-user, multi-task, multi-threaded and multi-CPU operating system, using Linux can run major Unix tools, applications and network protocols.
The above is the whole content of what is the specific method of setting static IP in Linux bridge mode, and more content related to the specific method of setting static IP in Linux bridge mode can search the previous article or browse the following article to learn ha! I believe the editor will add more knowledge to you. I hope you can support it!
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.