当前位置:网站首页>iptables nat
iptables nat
2022-08-11 05:33:00 【macob】
打开路由转发
[[email protected] ~]# echo "1" > /proc/sys/net/ipv4/ip_forward
1、一对多nat
iptables -t nat -A POSTROUTING -o eth0 -s 192.168.0.0/24 -j SNAT --to 1.1.1.1
公网IP不固定
iptables -t nat -A POSTROUTING -o eth0 -s 192.168.0.0/24 -j MASQUERADE
2、多对多nat
iptables -t nat -A POSTROUTING -o eth0 -s 192.168.0.0/24 -j SNAT --to 1.1.1.1-1.1.1.5
3、一对一nat
iptables -t nat -A PREROUTING -i eth0 -d 1.1.1.1 -j DNAT --to 192.168.0.1
4、NAPT
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j DNAT --to 192.168.0.1:80
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j DNAT --to 192.168.0.1:443
边栏推荐
猜你喜欢
AUTOMATION DAY07( Ansible Vault 、 普通用户使用ansible)
CLUSTER DAY02 (Keepalived Hot Standby, Keepalived+LVS, HAProxy Server)
(二)软件测试理论(*重点用例方法编写)
FusionCompute8.0.0实验(0)CNA及VRM安装(2280v2)
Memory debugging tools Electric Fence
SECURITY DAY04( Prometheus服务器 、 Prometheus被监控端 、 Grafana 、 监控数据库)
arcgis填坑_1
slurm cluster construction
ETCD集群故障应急恢复-从snapshot恢复
照片的35x45,300dpi怎么弄
随机推荐
无胁科技-TVD每日漏洞情报-2022-8-5
SECURITY DAY05(Kali系统 、 扫描与抓包 、 SSH基本防护、服务安全 )
推荐一个好用的IDEA插件---Translation—中英互译
【LeetCode】306.累加数(思路+题解)
项目笔记——随机2
Login error in mysql: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)ERROR
Es common operations and classical case
CLUSTER DAY04 (Block Storage Use Cases, Distributed File Systems, Object Storage)
ramdisk实践1:将根文件系统集成到内核中
Apache Fink 文件上传漏洞复现及利用
VMware workstation 16 安装与配置
Threatless Technology-TVD Daily Vulnerability Intelligence-2022-7-20
Windos10专业版开启远程桌面协助
xx is not recognized as internal or external command
胖鸟博客之勒索病毒紧急处理文件恢复及防范方案
buildroot设置dhcp
中国移动通信集团有限公司:业务委托书
No threat of science and technology - TVD vulnerability information daily - 2022-8-4
China Mobile Communications Group Co., Ltd.: Business Power of Attorney
Threatless Technology-TVD Daily Vulnerability Intelligence-2022-8-5