zoukankan      html  css  js  c++  java
  • iptables的physdev配置说明 --physdev-in --physdev-out --physdev-is-in --physdev-is-out

    http://ipset.netfilter.org/iptables-extensions.man.html

    physdev

    This module matches on the bridge port input and output devices enslavedto a bridge device. This module is a part of the infrastructure that enablesa transparent bridging IP firewall and is only useful for kernel versionsabove version 2.5.44.
    [!] --physdev-in name
    Name of a bridge port via which a packet is received (only forpackets entering theINPUT,FORWARDandPREROUTINGchains). If the interface name ends in a "+", then anyinterface which begins with this name will match. If the packet didn't arrivethrough a bridge device, this packet won't match this option, unless '!' is used.
    [!] --physdev-out name
    Name of a bridge port via which a packet is going to be sent (for packetsentering theFORWARD,OUTPUTandPOSTROUTINGchains). If the interface name ends in a "+", then anyinterface which begins with this name will match. Note that in thenat and mangleOUTPUTchains one cannot match on the bridge output port, however one can in thefilter OUTPUTchain. If the packet won't leave by a bridge device or if it is yet unknown whatthe output device will be, then the packet won't match this option,unless '!' is used.
    [!] --physdev-is-in
    Matches if the packet has entered through a bridge interface.
    [!] --physdev-is-out
    Matches if the packet will leave through a bridge interface.
    [!] --physdev-is-bridged
    Matches if the packet is being bridged and therefore is not being routed.This is only useful in the FORWARD and POSTROUTING chains.

    ----------------------------------------------------------------------------------------------------------------------

    编译内核时,检查一下 CONFIG_SYSCTL

    ----------------------------------------------------------------------------------------------------------------------

    gedit kernel/net/bridge/br_netfilter_hooks.c

    #ifdef CONFIG_SYSCTL
    static
    int brnf_sysctl_call_tables(struct ctl_table *ctl, int write,
    			    void __user *buffer, size_t *lenp, loff_t *ppos)
    {
    	int ret;
    
    	ret = proc_dointvec(ctl, write, buffer, lenp, ppos);
    
    	if (write && *(int *)(ctl->data))
    		*(int *)(ctl->data) = 1;
    	return ret;
    }
    
    static struct ctl_table brnf_table[] = {
    	{
    		.procname	= "bridge-nf-call-arptables",
    		.data		= &brnf_call_arptables,
    		.maxlen		= sizeof(int),
    		.mode		= 0644,
    		.proc_handler	= brnf_sysctl_call_tables,
    	},
    	{
    		.procname	= "bridge-nf-call-iptables",
    		.data		= &brnf_call_iptables,
    		.maxlen		= sizeof(int),
    		.mode		= 0644,
    		.proc_handler	= brnf_sysctl_call_tables,
    	},
    	{
    		.procname	= "bridge-nf-call-ip6tables",
    		.data		= &brnf_call_ip6tables,
    		.maxlen		= sizeof(int),
    		.mode		= 0644,
    		.proc_handler	= brnf_sysctl_call_tables,
    	},
    	{
    		.procname	= "bridge-nf-filter-vlan-tagged",
    		.data		= &brnf_filter_vlan_tagged,
    		.maxlen		= sizeof(int),
    		.mode		= 0644,
    		.proc_handler	= brnf_sysctl_call_tables,
    	},
    	{
    		.procname	= "bridge-nf-filter-pppoe-tagged",
    		.data		= &brnf_filter_pppoe_tagged,
    		.maxlen		= sizeof(int),
    		.mode		= 0644,
    		.proc_handler	= brnf_sysctl_call_tables,
    	},
    	{
    		.procname	= "bridge-nf-pass-vlan-input-dev",
    		.data		= &brnf_pass_vlan_indev,
    		.maxlen		= sizeof(int),
    		.mode		= 0644,
    		.proc_handler	= brnf_sysctl_call_tables,
    	},
    	{ }
    };
    #endif
    


  • 相关阅读:
    苹果远程推送测试
    iOS 模糊化效果 ANBlurredImageView的使用
    VS2015中正确添加GIF的方式
    十大经典排序算法
    Windows Error Code(windows错误代码详解)
    C++捕获系统异常(VS2015设置)
    Qt5 error LNK2019 无法解析的外部符号的解决办法
    Linux常用命令大全(非常全!!!)
    利用MFC Picture Control控件 加载bmp,png
    在C++中如何实现文件的读写
  • 原文地址:https://www.cnblogs.com/ztguang/p/12644591.html
Copyright © 2011-2022 走看看