[Linux] Kali configuration network card

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.
insert image description here

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.)

  1. select vm虚拟机 - 编辑 - 虚拟网络编辑器:
  2. Select VMnet8, which 子网IPis mainly used to set the network segment.
    insert image description here
  3. NAT settings. 网关IPJust set the IP of your own physical host in the NAT settings .
    insert image description here
    insert image description here
  4. For DHCP settings, just fill in the start and end range of the network segment.
    bold style
  5. last step! Remember to tick!
    insert image description here

**

The second step network card configuration

We still take setting a static IP as an example. Edit vi /etc/network/interfacesthe 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.confadd 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:
insert image description hereFinally, 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:
insert image description heresimilar 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:
insert image description here

insert image description here

sudo service NetworkManager restart
sudo service networking restart

that's all right

Guess you like

Origin blog.csdn.net/ruisasaki/article/details/130046104