1. 程式人生 > >kali linux下的網絡配置

kali linux下的網絡配置

networkmanager 固定ip kali

最近拿著kali在虛擬機上玩一下,需要對網卡配置靜態IP地址;通過圖形化界面配置以後,發現/etc/network/interfaces裏面並沒有顯示IP地址,也找不到在哪裏,經過查閱資料確定了位置;

  1. 系統版本

[email protected]:~# cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
[email protected]
/* */:~# uname -a Linux kali 4.9.0-kali4-amd64 #1 SMP Debian 4.9.25-1kali1 (2017-05-04) x86_64 GNU/Linux [email protected]:~# more /etc/os-release PRETTY_NAME="Kali GNU/Linux Rolling" NAME="Kali GNU/Linux" ID=kali VERSION="2017.1" VERSION_ID="2017.1" ID_LIKE=debian ANSI_COLOR="1;31" HOME_URL="http://www.kali.org/" SUPPORT_URL="http://forums.kali.org/" BUG_REPORT_URL="http://bugs.kali.org/"

2.想到新版的linux中有NetworkManager工具管理網絡配置信息,所以找到/etc/NetworkManager/system-connections目錄下面,發現有一個文件,通過查看這個文件時發現裏面有網絡地址的配置信息,如下:

[email protected]:/etc/NetworkManager/system-connections# pwd
/etc/NetworkManager/system-connections
[email protected]:/etc/NetworkManager/system-connections# ll
總用量 4.0K
-rw------- 1 root root 315 5月   9 12:45 Wired connection 1
[email protected]
/* */:/etc/NetworkManager/system-connections# cat Wired\ connection\ 1 [connection] id=Wired connection 1 uuid=f33717da-334a-4c31-b0be-bbba3a9606c7 type=ethernet permissions= timestamp=1494305073 [ethernet] mac-address-blacklist= [ipv4] address1=192.168.20.222/24,192.168.20.254 dns=8.8.8.8; dns-search= method=manual [ipv6] addr-gen-mode=eui64 dns-search= ip6-privacy=2 method=auto [email protected]:/etc/NetworkManager/system-connections# ll 總用量 4.0K -rw------- 1 root root 315 5月 9 12:45 Wired connection 1 [email protected]:/etc/NetworkManager/system-connections#

3.通過systemctl disable NetworkManager.service服務後進行重啟,發現IP地址沒有加載,網絡沒有生效,說明網絡的IP目前由NetworkManager來進行控制的

[email protected]:/etc/NetworkManager/system-connections# systemctl disable NetworkManager.service
Removed /etc/systemd/system/multi-user.target.wants/NetworkManager.service.
Removed /etc/systemd/system/dbus-org.freedesktop.nm-dispatcher.service.
[email protected]:/etc/NetworkManager/system-connections#

4.目前NetworkManager與/etc/network/networking的作用我還沒有進行比較。


kali linux下的網絡配置