惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V
Vulnerabilities – Threatpost
U
Unit 42
F
Fortinet All Blogs
aimingoo的专栏
aimingoo的专栏
P
Proofpoint News Feed
F
Full Disclosure
月光博客
月光博客
Engineering at Meta
Engineering at Meta
博客园_首页
The Register - Security
The Register - Security
G
Google Developers Blog
The Cloudflare Blog
博客园 - Franky
K
Kaspersky official blog
A
Arctic Wolf
Scott Helme
Scott Helme
C
Cisco Blogs
Hugging Face - Blog
Hugging Face - Blog
C
Check Point Blog
NISL@THU
NISL@THU
AI
AI
D
DataBreaches.Net
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Stack Overflow Blog
Stack Overflow Blog
Project Zero
Project Zero
The GitHub Blog
The GitHub Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
量子位
Vercel News
Vercel News
T
Tor Project blog
P
Privacy International News Feed
D
Docker
I
Intezer
L
LangChain Blog
P
Proofpoint News Feed
Security Latest
Security Latest
C
CXSECURITY Database RSS Feed - CXSecurity.com
T
Threatpost
博客园 - 聂微东
AWS News Blog
AWS News Blog
Martin Fowler
Martin Fowler
P
Privacy & Cybersecurity Law Blog
V
V2EX
Last Week in AI
Last Week in AI
C
Cybersecurity and Infrastructure Security Agency CISA
The Hacker News
The Hacker News
T
Tenable Blog
Blog — PlanetScale
Blog — PlanetScale
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
T
Tailwind CSS Blog

博客园 - 心雨无痕

升级openssl和openssh linux配置LVM 杂七杂八 .net程序包含webbrowser插件时遇到的各种问题 mysql连接远程服务器很慢的解决方法 centos安装php需要注意的问题 centos配置nfs杂七杂八 桥接模式 适配器模式 单例模式 原型模式 工厂方法模式 简单工厂模式 建造者模式 ActionScript中Object和Dictionary的区别 FlashBuilder4.5破解方法 抽象工厂模式 设计模式浅见 了解下常见的开源协议
iptables配置网络端口转发
心雨无痕 · 2013-04-19 · via 博客园 - 心雨无痕

机器A通过机器B访问机器C的端口X,

    1. 机器B上编辑 /etc/sysctl.conf文件, 把net.ipv4.ip_forward = 0 改成 net.ipv4.ip_forward = 1, 然后/sbin/sysctl -p使修改的配置文件生效.

    2. 机器B上修改iptables的配置文件/etc/sysconfig/iptables(如果该文件不存在, 通过/sbin/iptables save创建一个), 把下列几句写到文件顶端:

*nat
:PREROUTING ACCEPT [116:9878]
:POSTROUTING ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A PREROUTING -p tcp -m tcp --dport X -j DNAT --to-destination C:X
-A POSTROUTING -p tcp -m tcp --dport X -j SNAT --to-source B
COMMIT

将机器B的端口X开放, 在上述的iptables的配置文件中的filter段, 加入:

-A RH-Firewall-1-INPUT -p tcp -m tcp --dport X -j ACCEPT

 然后/etc/init.d/iptables 生效.