beegucci
Senior Member
có giải pháp nào để cứu ko bácM cũng bị tình trạng vậy. Thi thoảng mất điện là phải cắm lại sfp rồi khởi động lại con 5009 mới được
có giải pháp nào để cứu ko bácM cũng bị tình trạng vậy. Thi thoảng mất điện là phải cắm lại sfp rồi khởi động lại con 5009 mới được
CóCó trường hợp nào mà bật fasttrack lên mà mạng chậm hơn cả khi không bật fasttrack không các b?
trường hợp nào vậy bác?
Chịu, xưa mình bị qua. Có fastrack vào nó giựt giựt.trường hợp nào vậy bác?
ok bácChịu, xưa mình bị qua. Có fastrack vào nó giựt giựt.
Giống kiểu 1 số rules có fastrack vào, nó bypass packages, mà kiểu leak gói tin. Thành ra 1 số gói đi theo fast track, 1 số gói ko bypass được, nó chuyển forward xuống rule firewall tiếp theo.
Nó giựt giựt, xài chung với hotspot là dính.
Ghét quá bỏ fast track luôn. Vì cần xài hotspot.
Ko nên xài fast track, nó bypass 1 số rule firewall nằm sau fast track.
Cái này lâu rồi. Từ đó là ko đụng tới fast track.
Ko có bác ah. M vẫn đang sống chung vs lũ. Mấy hôm bão hay bị mất chứ bt điện đóm cũng ổn định nên ko bực lắm.có giải pháp nào để cứu ko bác
Thím thử ssh vào con SFP mỗi khi nó không quay số được, thực hiện lệnh reboot sfp xem có quay số lại được không. Nếu quay được thì viết scriptsKo có bác ah. M vẫn đang sống chung vs lũ. Mấy hôm bão hay bị mất chứ bt điện đóm cũng ổn định nên ko bực lắm.
Mình sẽ test và update lại nhéThím thử ssh vào con SFP mỗi khi nó không quay số được, thực hiện lệnh reboot sfp xem có quay số lại được không. Nếu quay được thì viết scripts
Dạng như này, e tạo vlan10, vlan20. Chỉ dùng iptv trên vlan10 và phải có ra net nữa ấy bác. Còn vlan20 thì chỉ có net thôi. Ý e là vậy ạ.
Vậy bác chỉ giúp e cấu hình ntn để tối ưu iptv và chuyển luồng đó sang udpxy, giới hạn udpxy không bị scan ạ? Tks bác.
/interface list
add name=WAN
add name=LAN
/interface list member
add interface=BridgeLAN list=LAN
add interface=ether1 list=WAN
add interface=pppoe-out1 list=WAN
/ip firewall nat
add chain=srcnat out-interface-list=WAN ipsec-policy=out,none action=masquerade comment="defconf: masquerade"
/ip firewall filter
add chain=input action=accept connection-state=established,related,untracked comment="defconf: accept established,related,untracked"
add chain=input action=drop connection-state=invalid comment="defconf: drop invalid"
add chain=input action=accept protocol=icmp comment="defconf: accept ICMP"
add chain=input action=accept dst-address=127.0.0.1 comment="defconf: accept to local loopback (for CAPsMAN)"
add chain=input action=drop in-interface-list=!LAN comment="defconf: drop all not coming from LAN"
add chain=forward action=accept ipsec-policy=in,ipsec comment="defconf: accept in ipsec policy"
add chain=forward action=accept ipsec-policy=out,ipsec comment="defconf: accept out ipsec policy"
add chain=forward action=fasttrack-connection connection-state=established,related comment="defconf: fasttrack"
add chain=forward action=accept connection-state=established,related,untracked comment="defconf: accept established,related, untracked"
add chain=forward action=drop connection-state=invalid comment="defconf: drop invalid"
add chain=forward action=drop connection-state=new connection-nat-state=!dstnat in-interface-list=WAN comment="defconf: drop all from WAN not DSTNATed"
/ipv6 firewall address-list
add list=bad_ipv6 address=::/128 comment="defconf: unspecified address"
add list=bad_ipv6 address=::1 comment="defconf: lo"
add list=bad_ipv6 address=fec0::/10 comment="defconf: site-local"
add list=bad_ipv6 address=::ffff:0:0/96 comment="defconf: ipv4-mapped"
add list=bad_ipv6 address=::/96 comment="defconf: ipv4 compat"
add list=bad_ipv6 address=100::/64 comment="defconf: discard only "
add list=bad_ipv6 address=2001:db8::/32 comment="defconf: documentation"
add list=bad_ipv6 address=2001:10::/28 comment="defconf: ORCHID"
add list=bad_ipv6 address=3ffe::/16 comment="defconf: 6bone"
/ipv6 firewall filter
add chain=input action=accept connection-state=established,related,untracked comment="defconf: accept established,related,untracked"
add chain=input action=drop connection-state=invalid comment="defconf: drop invalid"
add chain=input action=accept protocol=icmpv6 comment="defconf: accept ICMPv6"
add chain=input action=accept protocol=udp dst-port=33434-33534 comment="defconf: accept UDP traceroute"
add chain=input action=accept protocol=udp dst-port=546 src-address=fe80::/10 comment="defconf: accept DHCPv6-Client prefix delegation."
add chain=input action=accept protocol=udp dst-port=500,4500 comment="defconf: accept IKE"
add chain=input action=accept protocol=ipsec-ah comment="defconf: accept ipsec AH"
add chain=input action=accept protocol=ipsec-esp comment="defconf: accept ipsec ESP"
add chain=input action=accept ipsec-policy=in,ipsec comment="defconf: accept all that matches ipsec policy"
add chain=input action=drop in-interface-list=!LAN comment="defconf: drop everything else not coming from LAN"
add chain=forward action=fasttrack-connection connection-state=established,related comment="defconf: fasttrack6"
add chain=forward action=accept connection-state=established,related,untracked comment="defconf: accept established,related,untracked"
add chain=forward action=drop connection-state=invalid comment="defconf: drop invalid"
add chain=forward action=drop src-address-list=bad_ipv6 comment="defconf: drop packets with bad src ipv6"
add chain=forward action=drop dst-address-list=bad_ipv6 comment="defconf: drop packets with bad dst ipv6"
add chain=forward action=drop protocol=icmpv6 hop-limit=equal:1 comment="defconf: rfc4890 drop hop-limit=1"
add chain=forward action=accept protocol=icmpv6 comment="defconf: accept ICMPv6"
add chain=forward action=accept protocol=139 comment="defconf: accept HIP"
add chain=forward action=accept protocol=udp dst-port=500,4500 comment="defconf: accept IKE"
add chain=forward action=accept protocol=ipsec-ah comment="defconf: accept ipsec AH"
add chain=forward action=accept protocol=ipsec-esp comment="defconf: accept ipsec ESP"
add chain=forward action=accept ipsec-policy=in,ipsec comment="defconf: accept all that matches ipsec policy"
add chain=forward action=drop in-interface-list=!LAN comment="defconf: drop everything else not coming from LAN"
/interface vlan
add interface=BridgeLAN name=vlan10 vlan-id=10
add interface=BridgeLAN name=vlan20 vlan-id=20
/ip address
add address=10.0.10.1/24 comment=vlan10 \
interface=vlan10 network=10.0.10.0
add address=10.0.20.1/24 comment=vlan20 \
interface=vlan20 network=10.0.20.0
/ip pool
add name=dhcp-vlan10 ranges=10.0.10.100-10.0.10.250
add name=dhcp-vlan20 ranges=10.0.20.100-10.0.20.250
/ip dhcp-server
add add-arp=yes address-pool=dhcp-vlan10 interface=vlan10 \
lease-time=10m name=vlan10
add add-arp=yes address-pool=dhcp-vlan20 interface=vlan20 \
lease-time=10m name=vlan20
/ip dhcp-server network
add address=10.0.10.0/24 comment=vlan10 \
dns-server=10.0.10.1 gateway=10.0.10.1 netmask=24
add address=10.0.20.0/24 comment=vlan20 \
dns-server=10.0.20.1 gateway=10.0.20.1 netmask=24
/interface list member
add interface=vlan10 list=LAN
add interface=vlan20 list=LAN
/interface ethernet switch vlan
add independent-learning=yes ports=ether2,switch1-cpu \
switch=switch1 vlan-id=1
add independent-learning=yes ports=ether3,switch1-cpu \
switch=switch1 vlan-id=10
add independent-learning=yes ports=ether4,ether5,switch1-cpu \
switch=switch1 vlan-id=20
/interface ethernet switch port
set ether2 default-vlan-id=1 vlan-header=leave-as-is vlan-mode=secure
set ether3 default-vlan-id=10 vlan-header=leave-as-is vlan-mode=secure
set ether4 default-vlan-id=20 vlan-header=leave-as-is vlan-mode=secure
set ether5 default-vlan-id=20 vlan-header=leave-as-is vlan-mode=secure
set switch1-cpu default-vlan-id=1 vlan-header=leave-as-is vlan-mode=secure
/interface ethernet switch vlan
add independent-learning=yes ports=ether2,ether3,ether5,switch1-cpu \
switch=switch1 vlan-id=10
add independent-learning=yes ports=ether2,ether4,ether5,switch1-cpu \
switch=switch1 vlan-id=20
/interface ethernet switch port
set ether2 vlan-header=leave-as-is vlan-mode=secure
set ether3 default-vlan-id=10 vlan-header=leave-as-is vlan-mode=secure
set ether4 default-vlan-id=20 vlan-header=leave-as-is vlan-mode=secure
set ether5 default-vlan-id=10 vlan-header=leave-as-is vlan-mode=secure
set switch1-cpu vlan-header=leave-as-is vlan-mode=secure
/routing igmp-proxy interface
add alternative-subnets=0.0.0.0/0 interface=ether1 upstream=yes
add interface=vlan10
/ip firewall filter
add action=drop chain=input comment="IPTV" dst-address=224.0.0.0/4 \
in-interface=ether1 protocol=udp
add action=accept chain=input comment="IPTV" \
in-interface=ether1 protocol=igmp
/ip firewall filter
add action=accept chain=forward comment="IPTV" dst-address=224.0.0.0/4 \
in-interface=ether1 protocol=udp
/usb1 ạ, bác sửa đường dẫn nếu không phải./system/device-mode/update container=yes
/container config
set ram-high=48.0MiB registry-url=https://registry-1.docker.io tmpdir=usb1/docker/pull
/interface veth
add address=10.0.100.10/24 gateway=10.0.100.1 name=veth-udpxy
/interface bridge
add name=containers protocol-mode=none
/interface bridge port
add bridge=containers interface=veth-udpxy
/ip address
add address=10.0.100.1/24 comment=containers interface=containers network=10.0.100.0
/interface list member
add interface=containers list=LAN
/routing igmp-proxy interface
add interface=containers
/container
add remote-image=sbzr/udpxy:latest interface=veth-udpxy \
root-dir=usb1/docker/udpxy start-on-boot=yes \
cmd="-T -c 8 -B 65536 -R 16 -H 3 -p 4000"
http://10.0.100.10:4000/status/ xem UDPXY đã chạy ở đúng cổng hay chưa. Nếu mọi thứ OK bác có thể sử dụng http://10.0.100.10:4000/ khi sửa các URL IPTV để chạy qua UDPXYChào các bác. Mình có con mikrotik RB3011UiAS-RM chạy 2 WAN. Mình nat port cho đầu ghi camera mà chỉ WAN 1 open còn WAN 2 vẫn close. Trong cấu hình NAT không có option chọn WAN 1 hay WAN 2. Bạn nào hỗ trợ mình với, tại ddns của hik nó trỏ WAN 1 hay WAN 2 là tùy hứng. Xin cảm ơn!
Đây là cấu hình NAT của mình
Xem tệp đính kèm 2667432
Xem tệp đính kèm 2667435
/routing table
add fib name=WAN1
add fib name=WAN2
/ip route
add distance=1 dst-address=0.0.0.0/0 gateway=pppoe-out1 routing-table=WAN1
add distance=1 dst-address=0.0.0.0/0 gateway=pppoe-out2 routing-table=WAN2
/interface list
add name=LAN
/interface list member
add interface=bridgeXXX list=LAN
add interface=vlanXXX list=LAN
...
/ip firewall mangle
add action=mark-connection chain=prerouting connection-mark=no-mark \
connection-state=new in-interface=pppoe-out1 \
new-connection-mark=IN_WAN1 passthrough=yes
add action=mark-connection chain=prerouting connection-mark=no-mark \
connection-state=new in-interface=pppoe-out2 \
new-connection-mark=IN_WAN2 passthrough=yes
/ip firewall mangle
add action=mark-routing chain=output connection-mark=IN_WAN1 \
new-routing-mark=WAN1 passthrough=no
add action=mark-routing chain=output connection-mark=IN_WAN2 \
new-routing-mark=WAN2 passthrough=no
/ip firewall mangle
add action=mark-routing chain=prerouting connection-mark=IN_WAN1 \
in-interface-list=LAN new-routing-mark=WAN1 passthrough=no
add action=mark-routing chain=prerouting connection-mark=IN_WAN2 \
in-interface-list=LAN new-routing-mark=WAN2 passthrough=no
new-routing-mark=xxx nếu không phải tên là WAN1 và WAN2.Thím @CGGX_ANNX cho mình hỏi thêm:
hiện tại chạy internet qua VLAN set theo SSID thì thấy thỉnh thoảng có lag hoặc chậm, kể cả dùng ethernet cắm qua LAN của cục H196A, trước đây set VLAN theo port thì internet rất nhanh và ko bị lag . Em ko rõ cái này do cục H196A hỗ trợ kém hay do em set config ko đúng ở chỗ nào đó.
Hơn nữa, nếu truy cập inter VLAN của 2 thiết bị cùng kết nối vào 1 cục H196A thì ko dc nhưng nếu giữa 2 cục khác nhau thì lại dc.
. Cảm ơn các bácMình không tìm thấy routing /table bạn àBác có 2 WAN vậy chắc bác đã có sẵn hai bảng routing table, với default route trong mỗi bảng là 1 trong hai đường WAN rồi đúng không ạ? Em giả sử hai bảng của bác tên là WAN1 và WAN2.
Còn nếu bác chưa tạo hai bảng route cho hai đường thì bác tham khảo spoiler này:
Ở đây em giả sử 2 đường WAN của bác tên là pppoe-out1 và pppoe-out2. Nếu bác dùng interface khác hoặc không dùng PPPoE mà dùng DHCP client thì sửa route tương ứng (có thể copy từ bảng main)
Mã:/routing table add fib name=WAN1 add fib name=WAN2 /ip route add distance=1 dst-address=0.0.0.0/0 gateway=pppoe-out1 routing-table=WAN1 add distance=1 dst-address=0.0.0.0/0 gateway=pppoe-out2 routing-table=WAN2
Bác tạo interface list LAN nếu chưa có, và thêm các bridge, các vlan v.v... vào list này. Ít ra bác cũng cần cho cái bridge hay vlan có cái host 192.168.1.100 kia vào list này:
Mã:/interface list add name=LAN /interface list member add interface=bridgeXXX list=LAN add interface=vlanXXX list=LAN ...
Sau đó bác cần thêm các rules mangle sau lên trên đỉnh của bảng IP -> Firewall -> Mangle. Với giả thuyết ở đây là hai interface WAN của bác tên là pppoe-out1 và pppoe-out2 và hai cái bảng routing tên là WAN1 và WAN2 ạ.
Mã:/ip firewall mangle add action=mark-connection chain=prerouting connection-mark=no-mark \ connection-state=new in-interface=pppoe-out1 \ new-connection-mark=IN_WAN1 passthrough=yes add action=mark-connection chain=prerouting connection-mark=no-mark \ connection-state=new in-interface=pppoe-out2 \ new-connection-mark=IN_WAN2 passthrough=yes /ip firewall mangle add action=mark-routing chain=output connection-mark=IN_WAN1 \ new-routing-mark=WAN1 passthrough=no add action=mark-routing chain=output connection-mark=IN_WAN2 \ new-routing-mark=WAN2 passthrough=no /ip firewall mangle add action=mark-routing chain=prerouting connection-mark=IN_WAN1 \ in-interface-list=LAN new-routing-mark=WAN1 passthrough=no add action=mark-routing chain=prerouting connection-mark=IN_WAN2 \ in-interface-list=LAN new-routing-mark=WAN2 passthrough=no
Nếu hai interface WAN của bác không phải pppoe-out1 với pppoe-out2 thì bác chỉnh sửa tương ứng. Tương tự, sửa tên bảng routing chỗnew-routing-mark=xxxnếu không phải tên là WAN1 và WAN2.
Quá chi tiết, đúng những thứ e thắc mắc. Đa tạ bác rất nhiều.Nếu bác không muốn khi chạy UDPXY mà bên ngoài internet cũng truy cập được nó thì đơn giản là bác cấu hình tường lửa cho đúng ạ. Nếu bác đã có sẵn các rules ở bảng filter mặc định chặn các kết nối từ ngoài vào rồi thì không cần làm gì nữa, còn nếu chưa có tường lửa bảo vệ thì bác có thể áp dụng cấu hình tường lửa từ Default Configuration (defconf) của MikroTik.
Cấu hình tường lửa này cần 2 interface list tên là WAN và LAN.
Mã:/interface list add name=WAN add name=LAN
Ở list LAN bác sẽ thêm các bridge, các interface vlan, các interface WireGuard nhận kết nối từ ngoài vào. Ở list WAN bác sẽ thêm các interface PPPoE client, các cổng nối ra modem/converter, cũng nhưng các interface VPN khi dùng dịch vụ VPN bên thứ 3, thí dụ, nếu bridge chính tên là BridgeLAN và kết nối quay PPPoE trên cổng ether1:
Mã:/interface list member add interface=BridgeLAN list=LAN add interface=ether1 list=WAN add interface=pppoe-out1 list=WAN
Với các interface list đã được thiết lập, bác có thể áp dụng cấu hình tường lửa của MikroTik cho bảng Filter và bảng NAT:
Mã:/ip firewall nat add chain=srcnat out-interface-list=WAN ipsec-policy=out,none action=masquerade comment="defconf: masquerade" /ip firewall filter add chain=input action=accept connection-state=established,related,untracked comment="defconf: accept established,related,untracked" add chain=input action=drop connection-state=invalid comment="defconf: drop invalid" add chain=input action=accept protocol=icmp comment="defconf: accept ICMP" add chain=input action=accept dst-address=127.0.0.1 comment="defconf: accept to local loopback (for CAPsMAN)" add chain=input action=drop in-interface-list=!LAN comment="defconf: drop all not coming from LAN" add chain=forward action=accept ipsec-policy=in,ipsec comment="defconf: accept in ipsec policy" add chain=forward action=accept ipsec-policy=out,ipsec comment="defconf: accept out ipsec policy" add chain=forward action=fasttrack-connection connection-state=established,related comment="defconf: fasttrack" add chain=forward action=accept connection-state=established,related,untracked comment="defconf: accept established,related, untracked" add chain=forward action=drop connection-state=invalid comment="defconf: drop invalid" add chain=forward action=drop connection-state=new connection-nat-state=!dstnat in-interface-list=WAN comment="defconf: drop all from WAN not DSTNATed" /ipv6 firewall address-list add list=bad_ipv6 address=::/128 comment="defconf: unspecified address" add list=bad_ipv6 address=::1 comment="defconf: lo" add list=bad_ipv6 address=fec0::/10 comment="defconf: site-local" add list=bad_ipv6 address=::ffff:0:0/96 comment="defconf: ipv4-mapped" add list=bad_ipv6 address=::/96 comment="defconf: ipv4 compat" add list=bad_ipv6 address=100::/64 comment="defconf: discard only " add list=bad_ipv6 address=2001:db8::/32 comment="defconf: documentation" add list=bad_ipv6 address=2001:10::/28 comment="defconf: ORCHID" add list=bad_ipv6 address=3ffe::/16 comment="defconf: 6bone" /ipv6 firewall filter add chain=input action=accept connection-state=established,related,untracked comment="defconf: accept established,related,untracked" add chain=input action=drop connection-state=invalid comment="defconf: drop invalid" add chain=input action=accept protocol=icmpv6 comment="defconf: accept ICMPv6" add chain=input action=accept protocol=udp dst-port=33434-33534 comment="defconf: accept UDP traceroute" add chain=input action=accept protocol=udp dst-port=546 src-address=fe80::/10 comment="defconf: accept DHCPv6-Client prefix delegation." add chain=input action=accept protocol=udp dst-port=500,4500 comment="defconf: accept IKE" add chain=input action=accept protocol=ipsec-ah comment="defconf: accept ipsec AH" add chain=input action=accept protocol=ipsec-esp comment="defconf: accept ipsec ESP" add chain=input action=accept ipsec-policy=in,ipsec comment="defconf: accept all that matches ipsec policy" add chain=input action=drop in-interface-list=!LAN comment="defconf: drop everything else not coming from LAN" add chain=forward action=accept connection-state=established,related,untracked comment="defconf: accept established,related,untracked" add chain=forward action=drop connection-state=invalid comment="defconf: drop invalid" add chain=forward action=drop src-address-list=bad_ipv6 comment="defconf: drop packets with bad src ipv6" add chain=forward action=drop dst-address-list=bad_ipv6 comment="defconf: drop packets with bad dst ipv6" add chain=forward action=drop protocol=icmpv6 hop-limit=equal:1 comment="defconf: rfc4890 drop hop-limit=1" add chain=forward action=accept protocol=icmpv6 comment="defconf: accept ICMPv6" add chain=forward action=accept protocol=139 comment="defconf: accept HIP" add chain=forward action=accept protocol=udp dst-port=500,4500 comment="defconf: accept IKE" add chain=forward action=accept protocol=ipsec-ah comment="defconf: accept ipsec AH" add chain=forward action=accept protocol=ipsec-esp comment="defconf: accept ipsec ESP" add chain=forward action=accept ipsec-policy=in,ipsec comment="defconf: accept all that matches ipsec policy" add chain=forward action=drop in-interface-list=!LAN comment="defconf: drop everything else not coming from LAN"
Nếu có các cổng trên router cần mở (thí dụ cho WireGuard) thì bác thêm vào các rule action=accept ở chain input và đặt trước rule có comment "defconf: drop all not coming from LAN".
Tiếp theo là phần cấu hình VLAN với giả sử là bác dùng thiết bị có switch chip Atheros8327 (như bác nhắc đến ở post trước) hay QCA8337. Thí dụ như các thiết bị hAP ac, hAP ac², hAP ac³, hEX PoE, RB2011, RB3011, RB1100AHx2 (không phải AHx4!). Còn nếu là các model mới hơn (RB4011, RB5009, L009, CCR2xxx) hay các con hEX RB750Gr3/hEX S RB760iGS thì làm theo cách như ở post này.
Ở đây em sẽ cấu hình hai VLAN 10 và 20 như bác nói ở trên. Đầu tiên là bác kiểm tra xem thiết bị của bác thuộc loại có mấy switch chip, nếu là RB1100AH/AHx2, RB2011, RB3011 thì sẽ có 2 switch chip. Khi này bác nên tạo các bridge ứng với từng switch chip, các cổng của 1 bridge thì nằm cùng 1 switch. Bác kiểm tra bảng Switch -> Port xem các cổng thuộc switch chip nào:
Xem tệp đính kèm 2681653
Và với các VLAN thì không nên cấu hình 1 VLAN bao cả cổng của 2 chip mà nên để tách biệt. Còn sau đây thì em giả sử router của bác chỉ có 1 switch chip (tên là switch1). Cổng ether1 dùng cho WAN nên nằm ngoài bridge, và Bridge chính tên là "BridgeLAN" gồm ether2-ether5.
1) Tạo các interface VLAN trên BridgeLAN
Mã:/interface vlan add interface=BridgeLAN name=vlan10 vlan-id=10 add interface=BridgeLAN name=vlan20 vlan-id=20
2) Gán địa chỉ, pool, DHCP server cho các VLANs:
Mã:/ip address add address=10.0.10.1/24 comment=vlan10 \ interface=vlan10 network=10.0.10.0 add address=10.0.20.1/24 comment=vlan20 \ interface=vlan20 network=10.0.20.0 /ip pool add name=dhcp-vlan10 ranges=10.0.10.100-10.0.10.250 add name=dhcp-vlan20 ranges=10.0.20.100-10.0.20.250 /ip dhcp-server add add-arp=yes address-pool=dhcp-vlan10 interface=vlan10 \ lease-time=10m name=vlan10 add add-arp=yes address-pool=dhcp-vlan20 interface=vlan20 \ lease-time=10m name=vlan20 /ip dhcp-server network add address=10.0.10.0/24 comment=vlan10 \ dns-server=10.0.10.1 gateway=10.0.10.1 netmask=24 add address=10.0.20.0/24 comment=vlan20 \ dns-server=10.0.20.1 gateway=10.0.20.1 netmask=24
(Ở trên dùng router làm DNS server nên cần bật IP -> DNS -> Allow Remote Requests. Nếu bác dùng DNS server khác thì sửa địa chỉ khác).
3) Cho các interface vào list LAN (nếu dùng tường lửa dựa trên defconf)
Mã:/interface list member add interface=vlan10 list=LAN add interface=vlan20 list=LAN
Tiếp theo là phần cấu hình VLAN trên switch chip. Em sẽ đưa một số thí dụ cấu hình phân chia các cổng:
Nếu bác muốn cắm dây vào ether2 vẫn giữ nguyên là nối vào bridge chính BridgeLAN, còn cắm dây vào ether3 thì các thiết bị nằm trong VLAN 10 và VLAN này không có tag (ether3 là access port của VLAN 10), và cắm ether4 và ether5 thì các thiết bị nằm trong VLAN 20 và cũng không có tag (ether4 và ether5 là access port của VLAN 20) thì có thể cấu hình như này:
4a) Thêm danh sách các cổng được sử dụng cho từng VLAN ID. Cổng CPU của switch switch1-cpu, cũng phải nằm trong danh sách các cổng thì mới sử dụng được VLAN ở layer 3:
Mã:/interface ethernet switch vlan add independent-learning=yes ports=ether3,switch1-cpu \ switch=switch1 vlan-id=10 add independent-learning=yes ports=ether4,ether5,switch1-cpu \ switch=switch1 vlan-id=20
5a) Cấu hình cổng ether3 là access port của VLAN 10, và ether4, ether5 là access ports của VLAN 20, bằng cách set default-vlan-id. Ngoài ra cũng phải bật chế độ VLAN = secure trên cổng CPU của switch (cổng này dùng cho router):
Mã:/interface ethernet switch port set ether3 default-vlan-id=10 vlan-header=leave-as-is vlan-mode=secure set ether4 default-vlan-id=20 vlan-header=leave-as-is vlan-mode=secure set ether5 default-vlan-id=20 vlan-header=leave-as-is vlan-mode=secure set switch1-cpu vlan-header=leave-as-is vlan-mode=secure
Một thí dụ khác là nếu bác muốn ether2 là trunk port của VLAN 10 và 20 (mang cả 2 VLAN ở dạng tagged), muốn ether3 là access port của VLAN 10, ether4 là access port của VLAN 20, và cổng ether5 là hybrid port mạng VLAN 10 untagged và VLAN 20 tagged:
4b) Thêm danh sách các cổng được sử dụng cho từng VLAN ID:
Mã:/interface ethernet switch vlan add independent-learning=yes ports=ether2,ether3,ether5,switch1-cpu \ switch=switch1 vlan-id=10 add independent-learning=yes ports=ether2,ether4,ether5,switch1-cpu \ switch=switch1 vlan-id=20
5b) Cấu hình cổng:
Mã:/interface ethernet switch port set ether2 vlan-header=leave-as-is vlan-mode=secure set ether3 default-vlan-id=10 vlan-header=leave-as-is vlan-mode=secure set ether4 default-vlan-id=20 vlan-header=leave-as-is vlan-mode=secure set ether5 default-vlan-id=10 vlan-header=leave-as-is vlan-mode=secure set switch1-cpu vlan-header=leave-as-is vlan-mode=secure
Bác chú ý không bật các tính năng như IGMP Snooping trên bridge hay ARP mode kiểu proxy hay local-proxy trên các bridge và VLAN nếu muốn có performance tốt!
Bác xem IPTV nên chắc cần cấu hình IGMP Proxy. Chắc bác cấu hình rồi nhưng em cũng đưa phần cấu hình ra đây vì nếu sử dụng tường lửa từ Default Configuration của MikroTik thì cần thêm rule vào bảng filter của tường lửa ạ.
Ở phần này thì em giả dụ ether1 là interface có nguồn IPTV ạ. Nếu IPTV của bác nguồn từ VLAN thì bác sẽ cần thay ether1 dưới đây thành interface vlan tương ứng.
1) Cấu hình IGMP proxy với ether1 là upstream và vlan10 là downstream interface:
Mã:/routing igmp-proxy interface add alternative-subnets=0.0.0.0/0 interface=ether1 upstream=yes add interface=vlan10
2) Thêm rules tường lửa trên chain input. Nếu dùng cấu hình defconf thì bác thêm 2 rules này và kéo nó lên bên trên rule có ghi "defconf: drop all not coming from LAN" (sửa chỗ ether1 nếu cần):
Mã:/ip firewall filter add action=drop chain=input comment="IPTV" dst-address=224.0.0.0/4 \ in-interface=ether1 protocol=udp add action=accept chain=input comment="IPTV" \ in-interface=ether1 protocol=igmp
3) Mở cổng trên chain forward. Nếu dùng cấu hình defconf thì bác thêm rule này và kéo nó lên trên rule có ghi "defconf: drop all from WAN not DSTNATed" (sửa chỗ ether1 nếu cần):
Mã:/ip firewall filter add action=accept chain=forward comment="IPTV" dst-address=224.0.0.0/4 \ in-interface=ether1 protocol=udp
Một lần nữa, bác chú ý đừng bật IGMP Snooping nhé, sẽ mất hardware offload!
Với router có cấu trúc CPU ARM (RB3011, hAP ac²/ac³ là các thí dụ có CPU ARM và switch chip 8327/8337) thì bác có thể cài UDPXY chạy luôn trong container trên router:
Vì các thiết bị không nhiều bộ nhớ trong cho lắm (hAP ac² còn có mỗi 15.3MiB) nên bác có cái USB stick cắm vào làm bộ nhớ mở rộng thì tốt ạ. Sau đây em giả thiết bác đã cắm USB, format và mount nó vào thư mục/usb1ạ, bác sửa đường dẫn nếu không phải.
1) Bật chế độ container nếu chưa bật. Để bật bác chạy lệnh
Mã:/system/device-mode/update container=yes
Sau đó bác cần khởi động thiết bị bằng cách tắt nguồn vật lý và bật lại.
2) Cấu hình thông tin registry. Với hAP ac² ít RAM (có mỗi 128MiB) thì có thể set ram-high=48MiB (thừa đủ cho UDPXY). Nếu có nhiều RAM hơn (>= 512MiB) thì bác có thể để 128 hoặc 200MiB nếu muốn.
Mã:/container config set ram-high=48.0MiB registry-url=https://registry-1.docker.io tmpdir=usb1/docker/pull
3) Tạo interface VETH và bridge chứa interface này. Cấu hình địa chỉ và cho vào interface list LAN, trong thí dụ này dải địa chỉ 10.0.100.0/24. Container sẽ ở địa chỉ 10.0.100.10:
Mã:/interface veth add address=10.0.100.10/24 gateway=10.0.100.1 name=veth-udpxy /interface bridge add name=containers protocol-mode=none /interface bridge port add bridge=containers interface=veth-udpxy /ip address add address=10.0.100.1/24 comment=containers interface=containers network=10.0.100.0 /interface list member add interface=containers list=LAN
4) Cho interface containers làm downstream interface chỗ IGMP Proxy:
Mã:/routing igmp-proxy interface add interface=containers
5) Thêm container UDPXY. Cho UDPXY sử dụng cổng 4000 (tham số -p)
Mã:/container add remote-image=sbzr/udpxy:latest interface=veth-udpxy \ root-dir=usb1/docker/udpxy start-on-boot=yes \ cmd="-T -c 8 -B 65536 -R 16 -H 3 -p 4000"
6) Start cái container vừa tạo và lấy browser kiểm tra ở trang statushttp://10.0.100.10:4000/status/xem UDPXY đã chạy ở đúng cổng hay chưa. Nếu mọi thứ OK bác có thể sử dụnghttp://10.0.100.10:4000/khi sửa các URL IPTV để chạy qua UDPXY



Mình không tìm thấy routing /table bạn à
Xem tệp đính kèm 2682789
new-routing-mark=xxx là nó sẽ tự tạo ra bảng ạ. Nhưng mà lúc này cái lệnh thêm route cho từng bảng nó cũng khác ạ. Ở các lệnh /ip route add ... bác thay routing-table=WAN1 bằng routing-mark=WAN1 ạ.Mình dùng mạng VNPT dùng mikrotik 5009 qua SFP huawei ma5671a có cấu hình Vlan 11 trực tiếp trên Sfp còn Vlan mục multicast mình ko điền (mình ko dùng IPTV) mà sao kiểm tra thấy cái TX multicast đếm của sfp nó cứ nhảy số (mục TX stats trong interface), còn RX multicast thì ko thấy nhảy. Như vậy có cần cấu hình multicast gì cho SFP để nó ko nhảy ko nhỷ các bác. Cảm ơn các bác
/ip neighbor discovery-settings có thiết lập discover-interface-list=static và do đó bao gồm các interface ethernet như cái cổng SFP của bác nên sẽ phát các gói tin multicast trên cổng này.mấy điểm bác nói trên Mikrotik em đều làm theo hết, inter-VLAN thì nếu trong cùng AP thì ko ping dc, còn nếu khác AP thì vẫn ping dc nhau ạEm không có con H196A nên không biết nó có bị ảnh hưởng gì về tốc độ khi bác cấu hình SSID với VLAN hay không. Còn trên con Router MikroTik của bác thì bác vào bảng Bridge -> Ports thì tất cả các interface ethernet vẫn còn chữ H ở cột này chứ ạ?
Xem tệp đính kèm 2682524
Trên con router RB750Gr3 của bác thì bác không nên bật IGMP Snooping cũng như DHCP Snooping. Ngoài ra bác chú ý chỗ chế độ ARP của các bridge và interface vlan thì không để là proxy-arp hoặc local-proxy-arp ạ.
Xem tệp đính kèm 2682526
Về vấn đề inter-VLAN. Nếu bác đang ở thiết bị của 1 VLAN thì có ping/mở WinBox được với địa chỉ IP của router bên VLAN kia không ạ. Thí dụ VLAN10 10.0.10.0/24, VLAN20 10.0.20.0/24 thì ở thiết bị dùng WiFi có địa chỉ 10.0.10.15 chẳng hạn có kết nối được vào router ở 10.0.20.1 không ạ?