zl程序教程

您现在的位置是:首页 >  系统

当前栏目

linux配置ip转发

Linux配置IP 转发
2023-06-13 09:12:00 时间

大家好,又见面了,我是你们的朋友全栈君。

====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’

发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/134706.html原文链接:https://javaforall.cn