標籤:networkmanager 固定ip kali
最近拿著kali在虛擬機器上玩一下,需要對網卡配置靜態IP地址;通過圖形化介面配置以後,發現/etc/network/interfaces裡面並沒有顯示IP地址,也找不到在哪裡,經過查閱資料確定了位置;
-
系統版本
[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 interfaceauto loiface lo inet loopback[email protected]:~# uname -aLinux 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=kaliVERSION="2017.1"VERSION_ID="2017.1"ID_LIKE=debianANSI_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 1uuid=f33717da-334a-4c31-b0be-bbba3a9606c7type=ethernetpermissions=timestamp=1494305073[ethernet]mac-address-blacklist=[ipv4]address1=192.168.20.222/24,192.168.20.254dns=8.8.8.8;dns-search=method=manual[ipv6]addr-gen-mode=eui64dns-search=ip6-privacy=2method=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.serviceRemoved /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下的網路設定