Table of contents
kali version: kali 2023.1 amd 64
fool mode
There is no difficulty in operation, so I won't explain it in detail. Remember to restart the network card when changing the mode.
systemctl restart networking
nat 8 mode
The first step is to set up the web editor
Before configuring the network we need to 虚拟网络编辑器
set it up. (If you have already set it up, you can skip to the second step directly.)
- select
vm虚拟机 - 编辑 - 虚拟网络编辑器
: - Select VMnet8, which
子网IP
is mainly used to set the network segment.
- NAT settings.
网关IP
Just set the IP of your own physical host in the NAT settings .
- For DHCP settings, just fill in the start and end range of the network segment.
- last step! Remember to tick!
**
The second step network card configuration
We still take setting a static IP as an example. Edit vi /etc/network/interfaces
the network card and add the following information:
auto eth0 网卡名称
iface eth0 inet static #静态,想弄成自动分配的把static改成dhcp就可以了
address 192.168.1.99 #IP
netmask 255.255.255.0 #子网掩码
gateway 192.168.1.9 #网关
:wq!
Save it, and it will take effect after restarting the network card:
systemctl restart networking
At this time, we still cannot access the Internet normally, and we need to complete the DNS configuration and vi /etc/resolv.conf
add the following content under the file (preferably consistent with the physical host):
nameserver 8.8.8.8
nameserver 114.114.114.114
Continue to restart the network card! done~
may encounter problems
I see that most people are willing to turn off NetworkManager for sharing, but it should be nothing. It is just a visual configuration service. After I configured it, I have been unable to connect to the Internet. I can ping within the LAN but cannot access the external network.
Then I clicked on the settings and found this tool. But I was surprised to find that 连接
this item was missing, that is wired
, I began to suspect the cause of the failure. So I decided to restore wired first. It may be that i failed to detect the connection of the network card.
restore wired
sudo service NetworkManager stop
vi /etc/NetworkManager/NetworkManager.conf
Change [ifupdown]
the false in to true. As shown in the picture:
Finally, type again:
sudo service NetworkManager restart
At this point wired is restored~
Internet configuration
Of course, the problem has not been solved at this time, but it will be soon at this point.
Observe carefully, he has managed all the configurations of your network card:
similar configurations such as gateway address and DNS are not loaded in the network card configuration, you can fill them in manually. Let me just circle some points that need to be noticed:
sudo service NetworkManager restart
sudo service networking restart
that's all right