AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-374770

aphid's questions

Martin Hope
aphid
Asked: 2024-08-15 18:00:08 +0800 CST

nftables:按接口和 IP 块进行过滤?

  • 6

这不起作用(通过 systemd 重启 nftables,它应该加载/etc/nftables.conf):

cat /etc/nftables.d/forward/example.conf

meta oifname "eth2" ip daddr 5.6.7.8/30 accept
^^^^^^^^^^^^^^^^^^^ ~~~~
Error: Statement after terminal statement has no effect

但这也不起作用:

ip daddr 5.6.7.8/30 meta oifname "eth2" accept
^^^^^^^^^^^^^^^^^^^ ~~~~
Error: Statement after terminal statement has no effect

这也不是(使用连接示例)

ip daddr . meta oifname {5.6.7.8/30 . "eth2"} accept
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error: Statement after terminal statement has no effect

注意:/etc/nftables.conf 的内容:

#!/usr/sbin/nft -f

flush ruleset

table inet filter {
        chain input {
                type filter hook input priority filter;
        }
        chain forward {
                type filter hook forward priority filter;
                include "/etc/nftables.d/forward/*.conf"
        }
        chain output {
                type filter hook output priority filter;
        }
}

我该如何同时执行这两项操作?如果此 IP 范围并不总是路由到 eth2(例如,策略路由),而 eth2 不只包含此 IP 范围,那么这是否有必要?

nftables
  • 1 个回答
  • 16 Views
Martin Hope
aphid
Asked: 2023-03-09 22:56:52 +0800 CST

不一致的配置文件修改屏幕背后的动机或原因是什么?

  • 7

通过在不同主机上更新 debian 操作系统 ( apt-get dist-upgrade),我看到了同一屏幕的许多微小变化;当配置文件被修改时,它会告诉你有新版本可用,并要求你修复问题:你修改了文件并且 apt/dpkg 不能可靠地将你的更改与新版本集成。

现在这个选项菜单在各种文件之间是不同的。有时甚至在同一个包内。

一些文件将具有“包配置”控制台 UI,其他文件将使用普通控制台输出。包配置 UI 中可用的选项并不总是相同的。

修改/新版本文件的名称并不总是相同的。新文件的存储位置并不总是它应该在的位置(有时它在'tmp'中)。新文件的命名方案也不一致(一些软件包使用随机名称,一些使用 -new,其他的 -dpkg-new,等等。)

有些软件包拒绝告诉您 dpkg 默认值在哪里。有些软件包不为您提供带有扩展名 dpkg-old 或 -old 或 -dist 或 -dpkg-dist 或 -old-nameofpackage 的先前版本,但其他软件包提供。(所以在某些情况下你可以手动进行 3 向合并,在其他情况下你不能)。一些软件包添加了一个方便的“在版本之间进行 3 种方式合并”(这总是我尝试的第一件事,因为它通常可以自动解决问题:配置文件中的大多数更改通常只是注释中的拼写错误修复。

显示的程序或方式并排差异也可能因包/文件而异。

所以我认为包管理系统的全部目的是创建一种安装和卸载程序的一致方式。便于用户管理。

这里出了什么问题;为什么它的 UI/UX如此可怕?用户至少可以做些什么来更改/修改apt

  • “进行三向合并”可用
  • 新文件总是以一致的方式重命名/放置?

由于在归结为相同的死记硬背过程时做同样的事情有 1,000 种微小的变化,因此必须手动重新阅读并弄清楚如何手动处理每个配置文件是很痛苦的。

为了说明我的意思,这里有两个来自升级;


Configuration file '/etc/ssh/ssh_config'
 ==> Modified (by you or by a script) since installation.
 ==> Package distributor has shipped an updated version.
   What would you like to do about it ?  Your options are:
    Y or I  : install the package maintainer's version
    N or O  : keep your currently-installed version
      D     : show the differences between the versions
      Z     : start a shell to examine the situation
 The default action is to keep your current version.
 
 A new version (/tmp/tmp.3RoEfdEm3M) of configuration file /etc/ssh/sshd_config is available, but the version installed currently has been locally modified.  
                                                                                                                                                              
 What do you want to do about modified configuration file sshd_config?                                                                                        
                                                                                                                                                              
                                                     install the package maintainer's version                                                                 
                                                     keep the local version currently installed                                                               
                                                     show the differences between the versions                                                                
                                                     show a side-by-side difference between the versions                                                      
                                                     show a 3-way difference between available versions                                                       
                                                     do a 3-way merge between available versions                                                              
                                                     start a new shell to examine the situation 

第二种变体中的那些选项?他们并不总是按照那个顺序在那里。

感觉就像这只是为了绊倒你。

debian
  • 2 个回答
  • 31 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    模块 i915 可能缺少固件 /lib/firmware/i915/*

    • 3 个回答
  • Marko Smith

    无法获取 jessie backports 存储库

    • 4 个回答
  • Marko Smith

    如何将 GPG 私钥和公钥导出到文件

    • 4 个回答
  • Marko Smith

    我们如何运行存储在变量中的命令?

    • 5 个回答
  • Marko Smith

    如何配置 systemd-resolved 和 systemd-networkd 以使用本地 DNS 服务器来解析本地域和远程 DNS 服务器来解析远程域?

    • 3 个回答
  • Marko Smith

    dist-upgrade 后 Kali Linux 中的 apt-get update 错误 [重复]

    • 2 个回答
  • Marko Smith

    如何从 systemctl 服务日志中查看最新的 x 行

    • 5 个回答
  • Marko Smith

    Nano - 跳转到文件末尾

    • 8 个回答
  • Marko Smith

    grub 错误:你需要先加载内核

    • 4 个回答
  • Marko Smith

    如何下载软件包而不是使用 apt-get 命令安装它?

    • 7 个回答
  • Martin Hope
    user12345 无法获取 jessie backports 存储库 2019-03-27 04:39:28 +0800 CST
  • Martin Hope
    Carl 为什么大多数 systemd 示例都包含 WantedBy=multi-user.target? 2019-03-15 11:49:25 +0800 CST
  • Martin Hope
    rocky 如何将 GPG 私钥和公钥导出到文件 2018-11-16 05:36:15 +0800 CST
  • Martin Hope
    Evan Carroll systemctl 状态显示:“状态:降级” 2018-06-03 18:48:17 +0800 CST
  • Martin Hope
    Tim 我们如何运行存储在变量中的命令? 2018-05-21 04:46:29 +0800 CST
  • Martin Hope
    Ankur S 为什么 /dev/null 是一个文件?为什么它的功能不作为一个简单的程序来实现? 2018-04-17 07:28:04 +0800 CST
  • Martin Hope
    user3191334 如何从 systemctl 服务日志中查看最新的 x 行 2018-02-07 00:14:16 +0800 CST
  • Martin Hope
    Marko Pacak Nano - 跳转到文件末尾 2018-02-01 01:53:03 +0800 CST
  • Martin Hope
    Kidburla 为什么真假这么大? 2018-01-26 12:14:47 +0800 CST
  • Martin Hope
    Christos Baziotis 在一个巨大的(70GB)、一行、文本文件中替换字符串 2017-12-30 06:58:33 +0800 CST

热门标签

linux bash debian shell-script text-processing ubuntu centos shell awk ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve