我有一个老的12.04服务器,它具有以下iptables规则:
Chain NAME (1 references)
target prot opt source destination
ACCEPT tcp -- anywhere anywhere tcp dpt:discard /* someservice */
ACCEPT udp -- anywhere anywhere udp dpt:port /* someservices */
ACCEPT tcp -- private-ip anywhere tcp dpt:domain
ACCEPT tcp -- private-ip anywhere tcp dpt:service /* service server */
Chain NAME2 (1 references)
target prot opt source destination
ACCEPT tcp -- anywhere anywhere tcp dpt:port
ACCEPT udp -- anywhere anywhere udp dpt:domain
ACCEPT udp -- anywhere anywhere udp dpt:tftp
ACCEPT udp -- anywhere anywhere udp dpt:bootps
ACCEPT udp -- anywhere anywhere udp dpt:bootpc
ACCEPT tcp -- anywhere anywhere tcp dpt:http
ACCEPT tcp -- anywhere anywhere tcp dpt:https
Chain OTHERNAME (1 references)
target prot opt source destination
DROP all -- public-ip anywhere
DROP all -- public-ip anywhere
DROP all -- public-ip anywhere
RETURN all -- anywhere anywhere这只是一个例子,有很多规则。我试图通过启动一个新的18.04VM来迁移服务器。除了iptable之外,我能够正确地传输所有的东西。当我做‘’iptables还原
我尝试从导出文件中手动输入命令,但是我得到:
iptables: No chain/target/match by that name.
or
iptables v1.6.1: Couldn't load target `OTHERNAME':No such file or directory
我在新服务器上添加了这些链名。旧的iptables版本是1.4.12。我也试过iptables转换器,但没什么用。
如果最终我无法添加那些iptables规则,那么使用ufw命令这些规则会是什么样的呢?
发布于 2020-03-04 14:41:01
解决了。我刚刚重新启动了VM,所以它升级了内核,现在的iptable恢复工作了。谢谢你们所有人。
https://serverfault.com/questions/1005522
复制相似问题