====ip转发======
1、vim /etc/sysctl.conf
修改配置
net.ipv4.ip_forward = 1
重启
sysctl -p
2、192.168.1.1:3307 转发到 192.168.1.2:3307
shell下执行:
iptables -t nat -A PREROUTING -p tcp --dport 3307 -j DNAT --to-destination 192.168.1.2:3307
iptables -t nat -A POSTROUTING -d 192.168.1.2 -p tcp --dport 3307 -j SNAT --to 192.168.1.1
保存修改
service iptables save
then it's ok ~~
(
=====匹配某个目录下的所有文件中的某个字符====
sudo find -type f -name '*.ini'|xargs grep 'port'
)