您好,歡迎來(lái)電子發(fā)燒友網(wǎng)! ,新用戶?[免費(fèi)注冊(cè)]

您的位置:電子發(fā)燒友網(wǎng)>電子百科>網(wǎng)絡(luò)>防火墻>

基于OpenWrt防火墻配置 - openwrt路由器防火墻配置方法

2017年12月27日 10:04 網(wǎng)絡(luò)整理 作者: 用戶評(píng)論(0

  基于OpenWrt防火墻配置(作為二級(jí)路由)

  

  uci show firewall

  uci add firewall rule

  uci set firewall.@rule[-1].name=LuCI

  uci set firewall.@rule[-1].src=wan

  uci set firewall.@rule[-1].proto=tcp

  uci set firewall.@rule[-1].dest_port=80

  uci set firewall.@rule[-1].target=ACCEPT

  uci commit

  uci add firewall rule

  uci set firewall.@rule[-1].name=SSH

  uci set firewall.@rule[-1].src=wan

  uci set firewall.@rule[-1].proto=tcp

  uci set firewall.@rule[-1].dest_port=22

  uci set firewall.@rule[-1].target=ACCEPT

  uci commit

  #手動(dòng)更改:高級(jí)設(shè)置-》Dropbear設(shè)置-》接口-》wan

  uci add firewall rule

  uci set firewall.@rule[-1].name=Samba_1

  uci set firewall.@rule[-1].src=wan

  uci set firewall.@rule[-1].proto=tcp

  uci set firewall.@rule[-1].dest_port=445

  uci set firewall.@rule[-1].target=ACCEPT

  uci add firewall rule

  uci set firewall.@rule[-1].name=Samba_2

  uci set firewall.@rule[-1].src=wan

  uci set firewall.@rule[-1].proto=tcp

  uci set firewall.@rule[-1].dest_port=8200

  uci set firewall.@rule[-1].target=ACCEPT

  uci commit

  uci add firewall rule

  uci set firewall.@rule[-1].name=nginx

  uci set firewall.@rule[-1].src=wan

  uci set firewall.@rule[-1].proto=tcp

  uci set firewall.@rule[-1].dest_port=99

  uci set firewall.@rule[-1].target=ACCEPT

  uci commit

  uci add firewall rule

  uci set firewall.@rule[-1].name=FTP

  uci set firewall.@rule[-1].src=wan

  uci set firewall.@rule[-1].proto=tcp

  uci set firewall.@rule[-1].dest_port=21

  uci set firewall.@rule[-1].target=ACCEPT

  uci commit

  uci add firewall rule

  uci set firewall.@rule[-1].name=telnet

  uci set firewall.@rule[-1].src=wan

  uci set firewall.@rule[-1].proto=tcp

  uci set firewall.@rule[-1].dest_port=23

  uci set firewall.@rule[-1].target=ACCEPT

  uci commit

  /etc/init.d/firewall restart

非常好我支持^.^

(0) 0%

不好我反對(duì)

(2) 100%

( 發(fā)表人:李倩 )

      發(fā)表評(píng)論

      用戶評(píng)論
      評(píng)價(jià):好評(píng)中評(píng)差評(píng)

      發(fā)表評(píng)論,獲取積分! 請(qǐng)遵守相關(guān)規(guī)定!

      ?