[System Installation] iptables 的状态显示找不到iptables service;明明装了,大神解惑
Tofloor
poster avatar
a1174582254
deepin
2022-02-01 23:11
Author

byq11@byq11-PC:/Desktop$ sudo apt install iptables
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
iptables 已经是最新版 (1.8.2.1-1+dde)。
下列软件包是自动安装的并且现在不需要了:
deepin-pw-check fbterm imageworsener libheif1 liblqr-1-0 libmaxminddb0 libqtermwidget5-0 libsmi2ldbl
libutempter0 libutf8proc2 libwireshark-data libwireshark11 libwiretap8 libwscodecs2 libwsutil9 libx86-1
qtermwidget5-data squashfs-tools x11-apps x11-session-utils xbitmaps xinit
使用'sudo apt autoremove'来卸载它(它们)。
升级了 0 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 233 个软件包未被升级。
byq11@byq11-PC:/Desktop$ iptables en
Bad argument en' Try iptables -h' or 'iptables --help' for more information.
byq11@byq11-PC:/Desktop$ iptables
iptables iptables-nft iptables-save
iptables-apply iptables-nft-restore iptables-translate
iptables-legacy iptables-nft-save iptables-xml
iptables-legacy-restore iptables-restore
iptables-legacy-save iptables-restore-translate
byq11@byq11-PC:/Desktop$ service
Display all 115 possibilities? (y or n)
byq11@byq11-PC:/Desktop$ service
Usage: service < option > | --status-all | [ service_name [ command | --full-restart ] ]
byq11@byq11-PC:/Desktop$ service iptables status
Unit iptables.service could not be found.
byq11@byq11-PC:~/Desktop$

Reply Favorite View the author
All Replies
a1174582254
deepin
2022-02-01 23:12
#1

byq11@byq11-PC:/Desktop$ service iptables start
Failed to start iptables.service: Unit iptables.service not found.
byq11@byq11-PC:/Desktop$

Reply View the author
a1174582254
deepin
2022-02-01 23:12
#2

环境变量的问题?

Reply View the author
a1174582254
deepin
2022-02-01 23:14
#3

byq11@byq11-PC:/Desktop$ whereis iptables
iptables: /usr/sbin/iptables /usr/share/iptables /usr/share/man/man8/iptables.8.gz
byq11@byq11-PC:/Desktop​ echo path

byq11@byq11-PC:/Desktop​ echo PATH
/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/sbin:/usr/sbin
byq11@byq11-PC:/Desktop$

Reply View the author
deepinuser17
deepin
2022-02-02 09:00
#4
从Debian 10 (深度20的基础版)开始, iptables被nftables取代了。 用户命令为iptables-nft.  
Debian/深度创建了一个默认的命令iptables以向后兼容。

nftables已经内置随内核启动运行。 用户可以用iptables-nft, iptables-save, iptables-restore来管理防火墙条例。
但是这些命令不如专门的用户工具来的方便。 专门的用户工具包括firewalld, ufw等。

firewalld在Redhat系列用的比较普遍。ufw在Ubuntu系列用的更普遍。

firewalld使用介绍链接:
https://www.digitalocean.com/community/tutorials/how-to-set-up-a-firewall-using-firewalld-on-centos-7

ufw使用介绍链接:
https://www.arubacloud.com/tutorial/how-to-set-up-and-configure-ufw-firewall-on-ubuntu-20-04.aspx

firewalld, ufw都可以在深度上安装。但只需要选择安装其中一个来使用。
Reply View the author