小米路由器4A千兆版(R4A) 关闭ipv6 防火墙

admin
2022-04-04 / 7 评论 / 33 阅读 / 正在检测是否收录...

上一篇介绍了,怎么开ssh。当然了开了ssh一切都简单了。
关闭ipv6防火墙有两个方法:完全关闭

ip6tables -F
ip6tables -X
ip6tables -P INPUT ACCEPT
ip6tables -P OUTPUT ACCEPT
ip6tables -P FORWARD ACCEPT

部分开放

ip6tables -I forwarding_rule -p tcp --dport 1234 -j ACCEPT

问题就是一重启就得再来一回。
比较牛逼的方法是设置定时执行
crontab -e

*/5 * * * * ip6tables -L | grep "tcp dpt:1234"; [ $? != 0 ] && echo "add port" && ip6tables -I forwarding_rule -p tcp --dport 1234 -j ACCEPT
0

评论 (7)

取消
  1. 头像
    ZeroWolf
    Windows 10 · Google Chrome
    @

    大佬,求定时执行完全关闭的命令,万分感谢!!!

    回复
  2. 头像
    cnvwcpxmzo
    Windows 10 · Google Chrome
    @

    怎么收藏这篇文章?

    回复
  3. 头像
    jvwyxydooh
    Windows 10 · Google Chrome
    @

    兄弟写的非常好 https://www.cscnn.com/

    回复
  4. 头像
    小轩
    Windows 10 · Google Chrome
    @

    大佬,求定时执行完全关闭的命令,万分感谢!!!

    回复
  5. 头像
    juiqeffavt
    Windows 10 · Google Chrome
    @

    建议标注关键步骤的注意事项。

    回复
  6. 头像
    ebhgfducwp
    Windows 10 · Google Chrome
    @

    作者的情感表达细腻入微,让人在阅读中找到了心灵的慰藉。

    回复
  7. 头像
    twlmcpnzeu
    Windows 10 · Google Chrome
    @

    选材新颖独特,通过细节描写赋予主题鲜活生命力。

    回复