本文介绍的内容有:更新Kali Linux 2020.x(Kali Rolling)系统、安装所需的依赖项、在Kali Linux 2020.x上安装GNS3及设置Docker支持。以下执行的命令都将附上详细的输出信息,供参考。
一、更新系统
通过将系统和所有安装的软件包更新到最新版本来开始安装:
sudo apt update
sudo apt upgrade
由于升级可能包含有关内核的更新,因此请重启系统:
sudo reboot
注:经过以上三个命令就可以更新完Kali Linux 2020.x系统。
三、安装所需的依赖项
更新程序包的APT索引:
$ sudo apt update
Get:1 http://kali.download/kali kali-rolling InRelease [30.5 kB]
Get:2 http://kali.download/kali kali-rolling/contrib Sources [63.7 kB]
Get:4 http://kali.download/kali kali-rolling/main Sources [13.8 MB]
Get:8 http://kali.download/kali kali-rolling/non-free Sources [127 kB]
Get:9 http://kali.download/kali kali-rolling/main amd64 Packages [17.5 MB]
Get:10 http://kali.download/kali kali-rolling/non-free amd64 Packages [202 kB]Get:11 http://kali.download/kali kali-rolling/contrib amd64 Packages [106 kB]Fetched 28.2 MB in 16s (1,769 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
安装以下软件依赖项:
sudo apt install -y python3-pip python3-pyqt5 python3-pyqt5.qtsvg python3-pyqt5.qtwebsockets qemu qemu-kvm qemu-utils libvirt-clients libvirt-daemon-system virtinst wireshark xtightvncviewer apt-transport-https ca-certificates curl gnupg2 software-properties-common
三、在Kali Linux上安装GNS3
最后,在Kali Linux 2020.x版本上执行GNS3的安装。
安装GNS3服务器组件:
$ sudo pip3 install gns3-server
Collecting gns3-server
Downloading gns3-server-2.2.17.tar.gz (8.7 MB) | 8.7 MB 4.2 MB/s
Requirement already satisfied: Jinja2>=2.7.3 in /usr/lib/python3/dist-packages (from gns3-server) (2.11.2)
Collecting aiofiles==0.5.0
Downloading aiofiles-0.5.0-py3-none-any.whl (11 kB)
Collecting aiohttp-cors==0.7.0
Downloading aiohttp_cors-0.7.0-py3-none-any.whl (27 kB)
Requirement already satisfied: aiohttp==3.6.2 in /usr/lib/python3/dist-packages (from gns3-server) (3.6.2)
Requirement already satisfied: async-timeout==3.0.1 in /usr/lib/python3/dist-packages (from gns3-server) (3.0.1)
Requirement already satisfied: distro>=1.3.0 in /usr/lib/python3/dist-packages (from gns3-server) (1.5.0)
Requirement already satisfied: jsonschema==3.2.0 in /usr/lib/python3/dist-packages (from gns3-server) (3.2.0)
Collecting psutil==5.6.7
Downloading psutil-5.6.7.tar.gz (448 kB) | 448 kB 4.9 MB/s
Collecting py-cpuinfo==7.0.0
Downloading py-cpuinfo-7.0.0.tar.gz (95 kB) | 95 kB 3.0 MB/s
Collecting sentry-sdk>=0.14.4
Downloading sentry_sdk-0.19.5-py2.py3-none-any.whl (128 kB) | 128 kB 4.7 MB/s
Requirement already satisfied: urllib3>=1.10.0 in /usr/lib/python3/dist-packages (from sentry-sdk>=0.14.4->gns3-server) (1.26.2)
Requirement already satisfied: certifi in /usr/lib/python3/dist-packages (from sentry-sdk>=0.14.4->gns3-server) (2020.6.20)
Building wheels for collected packages: gns3-server, psutil, py-cpuinfo
Building wheel for gns3-server (setup.py) ... done
Created wheel for gns3-server: filename=gns3_server-2.2.17-py3-none-any.whl size=9362887 sha256=d41b291e64f3296c747f99ccfd7a85080572274b270a173070d84abe03fa3e32
Stored in directory: /root/.cache/pip/wheels/7c/93/bf/6988e561eb06b210a54928f884483e35ce48ca7fad4c8bffc0
Building wheel for psutil (setup.py) ... done
Created wheel for psutil: filename=psutil-5.6.7-cp39-cp39-linux_x86_64.whl size=265842 sha256=02c84201fd411405155645990d6c833588c130ffb8dc4978c652e7561344e424
Stored in directory: /root/.cache/pip/wheels/67/e7/5d/b8eb44db682bf1a1859a6e6d2540045869edaee3731552adc0
Building wheel for py-cpuinfo (setup.py) ... done
Created wheel for py-cpuinfo: filename=py_cpuinfo-7.0.0-py3-none-any.whl size=20068 sha256=15426c9fbf5132b19bc648bc50137d21413486439ea1a25786f738ec3fa138f3
Stored in directory: /root/.cache/pip/wheels/7f/2c/24/85d73581e5927be15689598ed1f02fe2a40cc66314232507c4
Successfully built gns3-server psutil py-cpuinfo
Installing collected packages: aiofiles, aiohttp-cors, psutil, py-cpuinfo, sentry-sdk, gns3-server
Attempting uninstall: psutil
Found existing installation: psutil 5.7.3
Not uninstalling psutil at /usr/lib/python3/dist-packages, outside environment /usr
Can't uninstall 'psutil'. No files were found to uninstall.
Successfully installed aiofiles-0.5.0 aiohttp-cors-0.7.0 gns3-server-2.2.17 psutil-5.6.7 py-cpuinfo-7.0.0 sentry-sdk-0.19.5
等待安装完成,然后安装GUI组件:
$ sudo pip3 install gns3-gui
Collecting gns3-gui
Downloading gns3-gui-2.2.17.tar.gz (4.9 MB) | 4.9 MB 1.2 MB/s
Requirement already satisfied: distro>=1.3.0 in /usr/lib/python3/dist-packages (from gns3-gui) (1.5.0)
Requirement already satisfied: jsonschema==3.2.0 in /usr/lib/python3/dist-packages (from gns3-gui) (3.2.0)
Requirement already satisfied: psutil==5.6.7 in /usr/local/lib/python3.9/dist-packages (from gns3-gui) (5.6.7)
Requirement already satisfied: sentry-sdk>=0.14.4 in /usr/local/lib/python3.9/dist-packages (from gns3-gui) (0.19.5)
Requirement already satisfied: certifi in /usr/lib/python3/dist-packages (from sentry-sdk>=0.14.4->gns3-gui) (2020.6.20)
Requirement already satisfied: urllib3>=1.10.0 in /usr/lib/python3/dist-packages (from sentry-sdk>=0.14.4->gns3-gui) (1.26.2)
Building wheels for collected packages: gns3-gui
Building wheel for gns3-gui (setup.py) ... done
Created wheel for gns3-gui: filename=gns3_gui-2.2.17-py3-none-any.whl size=3815821 sha256=700245f3b2668c0c3cc4e6e4e015ea2ebef4f7a2703f44a8809869a8d9c38ba1
Stored in directory: /root/.cache/pip/wheels/a0/8c/61/bcfd1f0c4324732bb6a051a80a71c0bfa6bdce5e248b064cdb
Successfully built gns3-gui
Installing collected packages: gns3-gui
Successfully installed gns3-gui-2.2.17
您可以从CLI启动GNS3:
$ gns3
或者通过从桌面搜索GNS3应用程序并启动它:
下一步将是本地服务器的GNS3安装向导,然后继续创建您的第一个GNS3拓扑。参考在Ubuntu 20.04(Focal Fossa)上安装和启动GNS3的方法。
四、设置Docker支持
然后添加GNS3存储库:
sudo tee /etc/apt/sources.list.d/gns3.list<
deb http://ppa.launchpad.net/gns3/ppa/ubuntu bionic main
deb-src http://ppa.launchpad.net/gns3/ppa/ubuntu bionic main
EOF
导入GPG存储库密钥:
$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F88F6D313016330404F710FC9A2FD067A2E3EF7B
Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
Executing: /tmp/apt-key-gpghome.WQqu0nldXm/gpg.1.sh --keyserver keyserver.ubuntu.com --recv-keys F88F6D313016330404F710FC9A2FD067A2E3EF7B
gpg: key 9A2FD067A2E3EF7B: public key "Launchpad PPA for GNS3" imported
gpg: Total number processed: 1
gpg: imported: 1
更新APT包索引:
sudo apt update
然后安装dynamips ubridge:
$ sudo apt install dynamips ubridge
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
gns3
The following NEW packages will be installed:
dynamips ubridge
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 391 kB of archives.
After this operation, 1,190 kB of additional disk space will be used.
Get:1 http://ppa.launchpad.net/gns3/ppa/ubuntu bionic/main amd64 dynamips amd64 0.2.21-1~bionic1 [358 kB]
Get:2 http://ppa.launchpad.net/gns3/ppa/ubuntu bionic/main amd64 ubridge amd64 0.9.18-1~bionic1 [32.8 kB]
Fetched 391 kB in 9s (44.6 kB/s)
Preconfiguring packages ...
Selecting previously unselected package dynamips.
(Reading database ... 275469 files and directories currently installed.)
Preparing to unpack .../dynamips_0.2.21-1~bionic1_amd64.deb ...
Unpacking dynamips (0.2.21-1~bionic1) ...
Selecting previously unselected package ubridge.
Preparing to unpack .../ubridge_0.9.18-1~bionic1_amd64.deb ...
Unpacking ubridge (0.9.18-1~bionic1) ...
Setting up dynamips (0.2.21-1~bionic1) ...
Setting up ubridge (0.9.18-1~bionic1) ...
Processing triggers for man-db (2.9.3-2) ...
Processing triggers for kali-menu (2021.1.2) ...
将您的用户添加到以下组:
sudo usermod -aG kvm,libvirt,docker,ubridge,wireshark $USER
为防止意外地从该存储库中安装其他任何文件(暂时),请删除文件中的注释行:
sudo tee /etc/apt/sources.list.d/gns3.list<
#deb http://ppa.launchpad.net/gns3/ppa/ubuntu bionic main
#deb-src http://ppa.launchpad.net/gns3/ppa/ubuntu bionic main
EOF
刷新元数据:
sudo apt update
至此,设置Docker支持的操作完成了。
相关主题