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-499441

Tomato's questions

Martin Hope
Tomato
Asked: 2020-01-15 12:29:28 +0800 CST

nftables 支持字符串匹配支持

  • 0

iptables 可以按字符串匹配数据包。

dns 示例:

iptables -A INPUT -i eth0 -p udp --dport 53 -m string --hex-string "|09|proxypipe|03|net" --algo bm -j DROP

如何在 nftables 中执行这样的匹配?

nftables
  • 1 个回答
  • 1385 Views
Martin Hope
Tomato
Asked: 2019-12-05 05:07:33 +0800 CST

使用 nftables 查看 NAT 连接

  • 4

如何使用 nftables 跟踪 nat 传出连接。只需要查看 nat stats,或多或少使用了哪些输出地址。

root@nat-1:~# nft list table nat
table ip nat {
    chain post {
            type nat hook postrouting priority 100; policy accept;
            ip saddr 10.0.0.0/8 oif "bond0.926" snat to 19.246.159.1-19.246.159.7
    }

    chain pre {
            type nat hook prerouting priority -100; policy accept;
    }
}

netstat-nat 适用于 iptables,但不再适用于 nftables。

netstat-nat -S
Could not read info about connections from the kernel, make sure netfilter is enabled in kernel or by modules.

我当然可以使用 tcpdump,但应该有一些更好的实用程序 ;-)

nat
  • 1 个回答
  • 3805 Views
Martin Hope
Tomato
Asked: 2019-08-06 22:28:20 +0800 CST

通过过滤器或变量匹配网络前缀的 nftables 命名集

  • 1

我想匹配一组网络。匿名集工作正常,但我想创建前缀集以在需要时重用它。

nft add set filter AllowedSSH { type ipv4_addr\;} // type for addreses
nft add element filter AllowedSSH { 10.0.0.0/8 } // not working
nft add element filter AllowedSSH { 10.0.0.1 } // works by IP

我应该使用哪种正确类型的过滤器来执行此操作?

变量样式也不起作用:

nft define networks = { 10.0.0.0/8 }
nft add rule ip filter input ip saddr $networks tcp dport 22 accept
Error: syntax error, unexpected dport, expecting end of file or newline or semicolon
add rule ip filter input ip saddr tcp dport 53 counter accept
                                  ^^^^^

NFT 版本:

[root@foo ~]# nft -v
nftables v0.8 (Joe Btfsplk)

提前致谢。

nftables
  • 1 个回答
  • 1009 Views
Martin Hope
Tomato
Asked: 2019-01-26 06:59:06 +0800 CST

Edge-Core 选择性 QinQ 和标记的 VLAN

  • 1

我正在尝试使用选择性 QinQ 打包一些 vlan。我需要将 VID 19,18 注入 VID 15。

#Port facing SP
interface ethernet 1/18
 switchport allowed vlan add 15 tagged
 switchport dot1q-tunnel mode uplink
 description Dot1Q-OneVlan

# Switch Uplink Port    
interface ethernet 1/11
 switchport allowed vlan add 15,19,18 untagged
 switchport dot1q-tunnel mode access
 switchport dot1q-tunnel service 15 match cvid 19
 switchport dot1q-tunnel service 15 match cvid 18
 description Pure-Tagged-VLAN

所有 QinQ 都运行良好,但我有一些不需要注入到 15 的 vlan。例如,我希望端口 1/11 上有 VID 100 以将流量发送到我的访问客户端端口 1/2。

如何打包 vlan 19,18 到 15 并原封不动地转发 vlan 100,200?

vlan
  • 1 个回答
  • 307 Views
Martin Hope
Tomato
Asked: 2019-01-07 00:59:05 +0800 CST

JunOS SCU(源类)匹配在 vMX 18 上不起作用

  • 0

我在虚拟游乐场测试 Junos Subscriber Manager。一切似乎都很好,并且可以在真实硬件上按预期工作。但是带有源类 sclass_mytest 选项的动态配置文件不起作用。

如果我只禁用一行“source-class sclass_mytest”,一切都会变得正常,并且客户端会收到带有应用动态配置文件的 IP 地址。

使用源类 sclass_mytest 客户端根本无法获得 IP 地址 - 因为配置文件问题。

有谁知道如何调试配置文件并查看日志错误/警告?

动态配置文件配置摘录:

firewall {
    family inet {                       
        filter "$inet_in" {
            interface-specific;
            term service {
                from {
                    service-filter-hit;
                }
                then accept;
            }
            term First{
                from {
                    source-class sclass_mytest;
                }
                then {
                    policer "$policer_in";
                    service-accounting;
                    service-filter-hit;
                    accept;
                }
            }
            term Last{                
                then accept;
            }
        }
    }
...

看起来源类在路由表中有标记:

所有带有 community: 7:1 的前缀都标有 sclass_mytest

inet.0: 29 destinations, 29 routes (29 active, 0 holddown, 0 hidden)
1.0.4.0/22 (1 entry, 1 announced)
TSI:
KRT in-kernel 1.0.4.0/22 -> {50.0.0.1}
Source class: sclass_mytest
        *BGP    Preference: 170/-191
                Next hop type: Router, Next hop index: 662
                Address: 0xc808710
                Next-hop reference count: 48
                Source: 50.0.0.1
                Next hop: 50.0.0.1 via ae0.100, selected
                Session Id: 0x142
                State: <Secondary Active Ext>
                Peer AS:  123456
                Age: 14:16      Metric: 0 
                Validation State: unverified 
                Task: BGP_123456_789.50.0.0.1
                Announcement bits (1): 0-KRT 
                AS path: 123456 I
                Communities: 7:1
                Accepted
                Localpref: 195
                Router ID: 2.21.89.1    
                Primary Routing Table testrt.inet.0
juniper
  • 1 个回答
  • 74 Views
Martin Hope
Tomato
Asked: 2018-12-09 02:58:00 +0800 CST

所有端口上的 cisco 4948 IGMP 泛洪

  • 0

每个人

cisco WS-C4948-10GE (MPC8540) 上的多播出现问题。

我有两个开关在运行:

系统镜像文件为“bootflash: cat4000-i5k91s-mz.122-25.EWA9.bin ”,系统镜像文件为“bootflash: cat4500-entservicesk9-mz.122-46.SG.bin ”

两者都面临同样的问题。我已经使用具有多播功能的 vlan 100 配置了几个端口。然后它将多播泛洪到具有 vlan 100 的所有端口,消耗 50Mb/s 的链路带宽。

Swtich-2#show ip igmp snooping

Vlan 100:
--------
IGMP snooping                       : Enabled
IGMPv2 immediate leave              : Disabled
Explicit host tracking              : Enabled
Multicast router learning mode      : pim-dvmrp
CGMP interoperability mode          : IGMP_ONLY

Swtich-2#show mac address-table interface gigabitEthernet 1/7
Unicast Entries
 vlan   mac address     type        protocols               port
-------+---------------+--------+---------------------+--------------------
 100    64d1.5415.8a7b   dynamic ip                    GigabitEthernet1/7    

Multicast Entries
 vlan    mac address     type    ports
-------+---------------+-------+--------------------------------------------
100     ffff.ffff.ffff  system   Gi1/3,Gi1/7,Po1

Swtich-2#show ip igmp snooping mrouter 
Vlan    ports
----    -----
 100    Po1(dynamic)
cisco
  • 1 个回答
  • 256 Views

Sidebar

Stats

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

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

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

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve