location ~ /(announcements|knowledgebase|download|store|password|cart|account|subscription)(.*) { rewrite (.*) /index.php; }
location ~ /(.*)/(addons|apps|search|domains|help|services|setup|utilities|clients)(.*) { rewrite (.*) /admin/index.php;}方案一:
if (!-f $request_filename){ rewrite (.*) /index.php; }方案二:
rewrite ^/(announcements|knowledgebase|download|store|password|cart|account|subscription)(.*)$ /index.php;
其他设置:
location ~* \.(tpl|inc|cfg)$ { deny all; }
location ^~ /vendor/ { deny all; }
方案一主要匹配本地没有的就丢index.php上去, 也可以用try_files
方案二主要是直接进行rewrite.
其他配置主要是隐藏一些目录和文件不让访问.
总的来说用 location来匹配稍微稳妥一些, 例如 /admin/clientsservices.php 会被为静态匹配到, 还是得运用if来判断匹配.
smb跨网的速度慢到爆, 虽然可以在Installation profiles里面增加一个外带本地smb路径, 在能不改变就不改变的前提下解决.
在ROS里面把445,137,138,139的tcp和udp重新定向到网内的smb服务器ip上.
/ip firewall nat
add action=dst-nat chain=dstnat dst-address=远程SMB dst-address-type=!local dst-port=445,137,138,139 protocol=udp to-addresses=本地SMB
add action=dst-nat chain=dstnat dst-address=远程SMB dst-address-type=!local dst-port=445,137,138,139 protocol=tcp to-addresses=本地SMB
然后将nocps下smb目录文件同步出来, 先把nocps的smb挂载到本地目录然后用rsync进行同步, 然后再分发到其他区域的smb服务器.
其实能在路由上做nat的情况, 完全可以把smb单独出来分区域镜像跑, 但是我不太想去折腾了, 能省一步省一步.
Regular Expressions are used often for BGP route manipulation or filtering. In this lesson we’ll take a look at some useful regular expressions. First let’s take a look at the different characters that we can use:
Characters
?
| repeats the previous character one or zero times. |
*
| repeats the previous character zero or many times. |
+
| repeats the previous character one or more times. |
^
| matches the beginning of a string. |
$
| matches the end of a string. |
[]
| is a range. |
_
| matches the space between AS numbers or the end of the AS PATH list. |
\\
| is an escape character. You’ll need this for BGP confederations. |
Examples
| ^$ | matches an empty AS PATH so it will match all prefixes from the local AS. |
| ^51_ | matches prefixes from AS 51 that is directly connected to our AS. |
| _51_ | matches prefixes that transit AS 51. |
| _51$ | matches prefixes that originated in AS 51, the $ ensures that it’s the beginning of the AS PATH. |
| ^([0-9]+)_51 | matches prefixes from AS 51 where AS 51 is behind one of our directly connected AS’es. |
| ^51_([0-9]+) | matches prefixes from the clients of directly connected AS 51. |
| ^(51_)+([0-9]+) | matches prefixes from the clients of directly connected AS 51, where AS 51 might be doing AS PATH prepending. |
| ^51_([0-9]+_)+ | matches prefixes from the clients of directly connected AS 51, where the clients might be doing AS PATH prepending. |
| ^\65200\) | matches prefixed from confederation peer 65200. |
https://networklessons.com/bgp/bgp-regular-expressions-examples/
#----------------------
Summary Table
1. 查看接口的统计信息
* display interface命令用来查看接口当前运行状态和接口统计信息。
* display counters命令用来查看接口的流量统计计数。
* display counters error命令用来查看错误报文的统计信息。
* display counters rate命令用来查看接口的入方向或出方向流量速率。
* display counters top interface report用来显示接口流量TOP N的统计报告。
* display ip interface命令用来查看接口与IP相关的配置和统计信息,包括接口接收和发送的报文数、字节数和组播报文数,以及接口接收、发送、转发和丢弃的广播报文数。
2. 查看接口的状态
* display interface brief命令用来查看接口状态和配置的简要信息。
* display interface description命令用来查看指定接口的描述信息。
* display interface ethernet brief命令用来查看以太网接口的简要信息。
* display ip interface brief和display ip interface description命令用来查看接口与IP相关的简要信息,包括IP地址、子网掩码、物理链路和协议的Up/Down状态以及处于不同状态的接口数目。
3. 查看光功率和模块型号
* display interface interface-type interface-number查看某光口插入的光模块的信息。
* display transceiver diagnosis interface查看所有光口的收发光功率信息。
* display transceiver diagnosis interface interface-type interface-number查看某光口的收发光功率信息。
#!/bin/bash
dec2ip () {
local ip dec=$@
for e in {3..0}
do
((octet = dec / (256 ** e) ))
((dec -= octet * 256 ** e))
ip+=$delim$octet
delim=.
done
printf '%s\n' "$ip"
}
dec2ip "$@"#!/bin/bash
ip2dec () {
local a b c d ip=$@
IFS=. read -r a b c d <<< "$ip"
printf '%d\n' "$((a * 256 ** 3 + b * 256 ** 2 + c * 256 + d))"
}
ip2dec "$@"dec2ip ()
{
local v=$1
local i1=$((v>>24&255))
local i2=$((v>>16&255))
local i3=$((v>>8&255))
local i4=$((v&255))
printf '%d.%d.%d.%d\n' $i1 $i2 $i3 $i4
}
tohex
echo -n 10.0.14.5 | hexdump -e '/1 "%02x"';
ip2hex
gethostip -x 10.0.14.5
hex2ip
hextoip() { hex=$1; printf "%d." 0x${hex:0:2}; printf "%d." 0x${hex:2:2}; printf "%d." 0x${hex:4:2}; printf "%d" 0x${hex:6:2}; }
Linux Endpunkte
GRETAP
/bin/ip link add 命名 type gretap local 本地IPv4 remote 远程IPv4 ttl 255
/bin/ip link set dev 命名 up
VXLAN
/bin/ip link add 命名 type vxlan local 本地IPv4 remote 远程IPv4 dstport 4789 id 0 ttl 255
/bin/ip link set dev 命名 up
Ethernet over IP
# install
wget https://raw.githubusercontent.com/4b42/4ixp/master/eoip/install.sh -O /tmp/eoip.sh
chmod +x /tmp/eoip.sh
/tmp/eoip.sh
rm -f /tmp/eoip.sh
# config
cat << EOF > /etc/eoip.cfg
[eoip命名]
id=0
dst=远程IPv4
EOF
/usr/local/bin/eoip /etc/eoip.cfg
MikroTik RouterOS Endpunkte
/interface eoip add !keepalive name=命名 local-address=本地IPv4 remote-address=远程IPv4 tunnel-id=0
printf "user:$(openssl passwd -crypt 123456)\n" >>conf/htpasswd
首先, 近些年的版权投诉越来越完善, 以前中文内容基本很少有版权投诉.
从英文到韩日资源再到中文的资源, 逐渐的中文资源的投诉越来越多, 英文等外语类的投诉相对较少了很多.
因为版权的原因, 一有投诉有的人积极处理有的人装死跑路换一家主机商,反正市面上成群结队的主机供应商可以选, 都是东躲西藏的心态, 长期以往后形成了一种拔屌无情的形态.
常见的一些特征: 大部分技术比较菜知识储备少, 被入侵或者注入只能哭; 还保持着10多年前的只会采集外链模式 ;对于版权投诉部分人呈现出暴躁的状态, 对网络资源开销较大, 类似和次于早期开飞机场的.
经验总结:
总体来说这部分人有一定不错的营收, 喜欢套近乎获取一些技术支持,获取一些优势价格以及对版权投诉宽裕处理, 比较注重所失不注重所得. 不论提供多优势多有利条件都会随时扭头翻脸.
不建议提供太多的技术支持,资源支持等等, 在成本资源和人力资源方面超支的该收钱必须得收, 没有让步的必要.
对于版权投诉该处理就处理不要嫌麻烦, 投诉量大又不处理的完全没有留的必要, 趁早清退免于问题扩大.
ROS历史版本下载
https://www.routeros.co.id/
https://www.mikrotik.com/download/archive
SR、LR、ER、ZR常用于SFP+和XFP封装的模块.指的是传输距离,SR是短距离,通常几百米以内.LR10KM,ER40KM,ZR80KM
| 产品类型 | 传输距离 | 中心波长 | 接口 | 工作温度 | DDM |
| SFP-10G-SR | 300m | 852nm | Duplex LC | 0-70℃ | D |
| SFP-10G-LRM | 220m | 1310nm | Duplex LC | 0-70℃ | D |
| SFP-10G-LR | 10km | 1310nm | Duplex LC | 0-70℃ | D |
| SFP-10G-ER | 40km | 1550nm | Duplex LC | 0-70℃ | D |
| SFP-10G-ZR | 70km-80km | 1550nm | Duplex LC | 0-70℃ | D |


备份到文件
show configuration |display set |save backup.txt
从备份载入配置
load set backup.txt
首先得安装有ipmitool或者OpenIPMI的包以及加载相应的内核模块
yum install ipmitool -y -q
modprobe ipmi_watchdog
modprobe ipmi_poweroff
modprobe ipmi_devintf
modprobe ipmi_si
执行例子
ipmitool exec ipmi.txt -I lanplus -U '用户' -P '密码' -H IP地址
ipmi.txt内容例子
power status
sensor
mc info
user list
lan print
主要是把所有的命令写在一个文本里面, 不用每次发送命令都带上IP 用户名密码等等
尤其是遇上更改IPMI的IP配置和用户配置的时候, 省去了一大部分的冗余操作.
首先,为了方便rsa免密码登陆要事先准备好.
其次,如果有堡垒机穿透也要事先在ssh/config下配置好.
方法一
ssh [email protected] "cli<< EOF
show configuration|dis set
EOF
" |grep set >junos.backup.txt
方法二
ssh [email protected] 'csh -s' <./backup.sh |grep set > junos.backup.txt
方法二是用csh -s将本地的脚本文件内容抛到juniper上执行.
server {
listen 8080;
resolver 1.1.1.1;
location / {
proxy_bind $server_addr; #绑定请求的出口ip
# proxy_bind $remote_addr transparent; #这行很关键,启用透明代理
# proxy_set_header X-Real-IP $remote_addr; #这行是可选,把客户端IP头加到http自定义字段而已
proxy_pass $scheme://$http_host$request_uri;
proxy_set_header Host $http_host;
proxy_buffers 256 4k;
proxy_max_temp_file_size 0k;
proxy_connect_timeout 30;
proxy_send_timeout 60;
proxy_read_timeout 60;
proxy_next_upstream error timeout invalid_header http_502;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
deny 127.0.0.1;
}
连接那个IP 出口就是那个 IP
nginx打印IP方法
location /myip {
default_type text/plain;
return 200 "$remote_addr\n";
}
验证脚本
#!/bin/bash
TARGET_URL="验证地址/ip" # 建议加 https
while read -r proxy; do
# 使用 curl 测试代理,获取返回 IP
result=$(curl -s -x "http://$proxy:8080" --connect-timeout 3 --max-time 5 "$TARGET_URL")
if [ "$result" = "$proxy" ]; then
echo "$result ✅"
else
echo "$proxy ❌ ($result)"
fi
done
方法bash shell.sh <ip_list.txt
随机ip方案,需要oepnresty+lua来支持
access_by_lua_block {
local ips = {
"192.168.1.10",
"192.168.1.11",
"192.168.1.12",
...
}
local ip = ips[math.random(#ips)]
ngx.var.local_bind_ip = ip
}
proxy_bind $local_bind_ip;
- «
- 1
- ...
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- ...
- 66
- »