首页 > 编程知识 正文

linux配置ip详细步骤,linux的ip配置

时间:2023-05-05 21:00:48 阅读:237884 作者:79

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

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。