ROS加強精通過程--禁止 未授權用戶上網

安裝 和 基本設置我就不說了
主要 想說說 上網 控制這一方面
  1 禁止 未授權用戶上網;呵呵 也就是 沒收錢的 用戶 呵呵
       首先 需要綁定已經授權的 ip 然後就要用到 地址列表了 新建 地址列表 爲 VIP 然後 加入 已授權 用戶IP
然後 防火牆 添加
/ ip firewall filter
add chain=forward in-interface=lan src-address-list=!VIP action=drop
    comment="" disabled=no
意思就是禁止非VIP 地址列表上網  呵呵 很簡單的一個 例子 靠這一條 攔截了 不少 非法之徒 當然這對於下面客戶 是 交換機是 起作用的 要是 客戶在 下面加路由 呵呵 MAC 修改那也 是沒有 辦法的 就限制連接數吧 呵呵只要他 受的了 管他呢 不要 做的太絕
2 限制一些連接 如P2P 下載軟件
首先是 P2P啦 我這裏是 分時段 禁止 發現規則裏的 時間控制貌似 用不了 我的2927
新建規則
/ ip firewall filter
add chain=forward p2p=all-p2p action=drop comment="No_P2P" disabled=no
全部P2P連接禁止註釋爲No_P2P 然後系統 新建調度程序
No_P2P
設置一個 啓動時間 如19點 間隔一天 這樣每天 19點開始禁止P2P
/ip fir fil set [/ip fir fil find com="No_P2P"] disabled=no
/ip firewall connection remove [/ip firewall connection find connection-mark=p2p_conn]
上面有2條規則
/ip firewall connection remove [/ip firewall connection find connection-mark=p2p_conn]
是 做了小包優化那個 P2P 標記的 運行時候刪除所有 已經連接的p2p_conn標記的連接 老實說我的2927 對 P2P 也是 限制不死
然後需要 在 指定時間開啓P2P
調度程序 規定的 時間運行 也是 間隔時間 和禁止的時間一樣吧 隨便你發揮啦 給個思路就好了
/ip fir fil set [/ip fir fil find com="No_P2P"] disabled=yes
迅雷 新建
/ ip firewall filter
add chain=forward action=jump jump-target=xl comment="xunlei" disabled=no
新建一個跳轉 跳轉到 lx 鏈 當然你要 建立 lx 鏈如
/ ip firewall filter
add chain=xl dst-address=219.129.83.0/24 action=drop
    comment="Blockade_Thunder" disabled=no
add chain=xl dst-address=220.172.191.36 action=drop comment="" disabled=no
add chain=xl dst-address=61.183.55.0/24 action=drop comment="" disabled=no
add chain=xl dst-address=58.61.39.0/24 action=drop comment="" disabled=no
add chain=xl protocol=tcp dst-port=3076-3079 action=drop comment=""
    disabled=no
add chain=xl protocol=udp dst-port=3076-3079 action=drop comment=""
    disabled=no
add chain=xl dst-address=221.238.253.251 action=accept comment="Login IP"
    disabled=no
add chain=xl dst-address=221.238.252.0/24 protocol=tcp dst-port=80 action=drop
    comment="" disabled=no
add chain=xl protocol=udp dst-port=5004 action=drop comment="" disabled=no
add chain=xl protocol=tcp dst-port=5200 action=drop comment="" disabled=no
add chain=xl protocol=udp src-port=15000-15001 action=drop comment=""
    disabled=no
add chain=xl protocol=tcp dst-port=4661-4662 action=drop comment="No Emule"
    disabled=no
add chain=xl protocol=tcp dst-port=4242 action=drop comment="" disabled=no
add chain=xl dst-address=62.241.53.15 action=drop comment="" disabled=no
add chain=xl protocol=tcp dst-port=16881 action=drop comment="No BitSpirit"
    disabled=no
add chain=xl dst-address=60.190.236.0/24 action=drop comment="No PPlive TV"
    disabled=no
add chain=xl protocol=udp src-port=13404 action=drop comment="" disabled=no
然後也是規定時間 開啓
調度程序規定時間 開啓跳轉
/ip fir fil set [/ip fir fil find com="xunlei"] disabled=no
規定 是關閉跳轉
/ip fir fil set [/ip fir fil find com="xunlei"] disabled=yes
2 軟件的數據標記
  小包策略相信大家應該都有 所耳聞了吧 有沒有作用老實就我個人的 網絡 環境感受不到效果什麼的
接下來我要說的 是 真真切切可以 直接看到效果 的
首先
/ ip firewall mangle
add chain=forward protocol=tcp tcp-flags=syn action=change-mss new-mss=1400
    comment="MMS" disabled=no
mms 1400很重要 以下基本是 依據這個數據來了 要是這個修改了那很多數據基本要重新測了
以下是 本人親自測驗的數據庫 在此首發當然 用點心思的基本都能做到想到的
首先什麼呢 QQ旋風吧 在MMS 是1400的環境下
QQ旋風 數據包大小1078
/ ip firewall mangle
add chain=forward packet-size=1078 action=mark-packet new-packet-mark=1078
    passthrough=yes comment="xuanfeng" disabled=no
酷狗 數據包大小1084
/ ip firewall mangle
add chain=forward packet-size=1084 action=mark-packet new-packet-mark=1084
    passthrough=yes comment="kugou" disabled=no
大名頂頂的迅雷了 1468
/ ip firewall mangle
add chain=forward packet-size=1468 action=mark-packet new-packet-mark=1468
    passthrough=yes comment="xunlei" disabled=no
以下是 端口標記
有 QQ 常見遊戲端口
/ ip firewall mangle
add chain=forward protocol=tcp dst-port=443 action=mark-packet
    new-packet-mark=qq passthrough=yes comment="qq" disabled=no
add chain=forward protocol=tcp src-port=443 action=mark-packet
    new-packet-mark=qq passthrough=yes comment="" disabled=no
add chain=forward protocol=udp src-port=4000-4005 dst-port=8000-8005
    action=mark-packet new-packet-mark=qq passthrough=yes comment=""
    disabled=no
add chain=forward protocol=udp src-port=6000-6010 dst-port=8000-8005
    action=mark-packet new-packet-mark=qq passthrough=yes comment=""
    disabled=no
add chain=forward protocol=udp src-port=8000-8005 dst-port=4000-4005
    action=mark-packet new-packet-mark=qq passthrough=yes comment=""
    disabled=no
add chain=forward protocol=udp src-port=8000-8005 dst-port=6000-6010
    action=mark-packet new-packet-mark=qq passthrough=yes comment=""
    disabled=no
add chain=forward protocol=tcp dst-port=3724 action=mark-packet
    new-packet-mark=yx passthrough=yes comment="wow" disabled=no
add chain=forward protocol=tcp src-port=3724 action=mark-packet
    new-packet-mark=yx passthrough=yes comment="" disabled=no
add chain=forward protocol=tcp dst-port=80 content=html action=mark-packet
    new-packet-mark=80 passthrough=yes comment="http" disabled=no
add chain=forward protocol=tcp src-port=80 content=html action=mark-packet
    new-packet-mark=80 passthrough=yes comment="" disabled=no
add chain=forward protocol=udp dst-port=39311 action=mark-packet
    new-packet-mark=yx passthrough=yes comment="feic" disabled=no
add chain=forward protocol=udp src-port=39311 action=mark-packet
    new-packet-mark=yx passthrough=yes comment="" disabled=no
add chain=forward protocol=tcp dst-port=25510-25525 action=mark-packet
    new-packet-mark=yx passthrough=yes comment="au" disabled=no
add chain=forward protocol=tcp src-port=25510-25525 action=mark-packet
    new-packet-mark=yx passthrough=yes comment="" disabled=no
add chain=forward protocol=tcp dst-port=28688 action=mark-packet
    new-packet-mark=yx passthrough=yes comment="dahuaixiyou" disabled=no
add chain=forward protocol=tcp src-port=28688 action=mark-packet
    new-packet-mark=yx passthrough=yes comment="" disabled=no
add chain=forward protocol=tcp dst-port=32388 action=mark-packet
    new-packet-mark=yx passthrough=yes comment="" disabled=no
add chain=forward protocol=tcp src-port=32388 action=mark-packet
    new-packet-mark=yx passthrough=yes comment="" disabled=no
3 OK  了數據包是 標記出來了 那麼 現在對 標記出來的數據包 做 優先和 限速
限制旋風數據包 1078連接速度 爲640K 當然根據你自己的網絡環境設置啦 注意是最大 級別8
LB 是 父系如果你沒有做 小包的話 就改成你的內網網卡名吧
/ queue tree
add name="L1078" parent=LB packet-mark=1078 limit-at=0 queue=default
    priority=8 max-limit=640000 burst-limit=0 burst-threshold=0 burst-time=0s
    disabled=no
酷狗 1084標記 800K 呵呵級別8
add name="L1084" parent=LB packet-mark=1084 limit-at=0 queue=default
    priority=8 max-limit=800000 burst-limit=0 burst-threshold=0 burst-time=0s
    disabled=no
迅雷 1468 1500K 級別8
add name="L1468" parent=LB packet-mark=1468 limit-at=0 queue=default
    priority=8 max-limit=1500000 burst-limit=0 burst-threshold=0 burst-time=0s
    disabled=no
QQ 標記類 不限速度 優先1級
add name="Lqq" parent=LB packet-mark=qq limit-at=0 queue=default priority=1
    max-limit=0 burst-limit=0 burst-threshold=0 burst-time=0s disabled=no
遊戲也是 一樣
add name="Lyx" parent=LB packet-mark=yx limit-at=0 queue=default priority=1
    max-limit=0 burst-limit=0 burst-threshold=0 burst-time=0s disabled=no
還可以 做一下網頁標記
規則是
TCP 80端口
內包含
HTML 字樣
標記
然後也是 queue 優先 =======
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章