zoukankan      html  css  js  c++  java
  • 解决非相同网段的包被丢弃的问题

    close the firewell


    echo 0 > /proc/sys/net/ipv4/conf/ethx/rp_filter
    net.ipv4.netfilter.ip_conntrack_max
    或者


    /etc/sysctl.conf 中添加或者修改如下项


    # Uncomment the next two lines to enable Spoof protection (reverse-path filter)
    # Turn on Source Address Verification in all interfaces to
    # prevent some spoofing attacks
    net.ipv4.conf.default.rp_filter=0
    net.ipv4.conf.all.rp_filter=0


    /sbin/sysctl -p




    如果交换机不支持igmp v3,那设置如下配置
    echo 2 > /proc/sys/net/ipv4/conf/ethx/force_igmp_version // 强制使用IGMP v2




    可能需要的配置命令:
    ifup eth2
    ifdown eth2


    ifconfig em2 192.168.103.117 netmask 255.255.0.0
    route add -net 192.168.103.0 netmask 255.255.255.0 gw 192.168.103.254
    route del -net 192.168.103.0 netmask 255.255.255.0


    route add default gw 192.168.1.1


    查看IGMP协议交互:
    tcpdump -i eth0 igmp


    tcpdump -s 0 dst port 1156


    23:36:14.113877 IP 172.18.0.1 > 224.0.0.1: igmp query v2
    23:36:14.230570 IP 192.168.103.117 > 239.0.0.39: igmp v2 report 239.0.0.39
    23:36:17.008630 IP 192.168.103.117 > 224.0.0.251: igmp v2 report 224.0.0.251




    如果发现没有发送加入组播IGMP,而是以下这种,说明服务器在查找支持IGMP V3的交换机,
    这时可以强制使用IGMP v2


    23:36:14.113877 IP 172.18.0.1 > 224.0.0.1: igmp query v2
    23:36:17.008630 IP 192.168.103.117 > 224.0.0.22: igmp v2 report 224.0.0.22

    23:36:17.008630 IP 192.168.103.117 > 224.0.0.22: igmp v2 report 224.0.0.22



    cat /proc/sys/net/ipv4/conf/ethx/rp_filter



  • 相关阅读:
    Python学习笔记4—列表List
    Python学习笔记3—字符串
    电力项目十六--数据字典二
    电力项目十五--数据字典
    maven项目引入jar包
    电力项目十四--js添加highslider特效
    电力项目十三--js添加浮动框
    电力项目十二--运行监控中添加进度条
    panzer 电力项目十一--hibernate操作大文本字段Blob和Clob
    电力项目十--整合文本编辑器
  • 原文地址:https://www.cnblogs.com/luoyinjie/p/7219353.html
Copyright © 2011-2022 走看看