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

推荐订阅源

T
Tor Project blog
月光博客
月光博客
P
Proofpoint News Feed
大猫的无限游戏
大猫的无限游戏
N
News and Events Feed by Topic
The Cloudflare Blog
博客园_首页
NISL@THU
NISL@THU
量子位
A
Arctic Wolf
Y
Y Combinator Blog
Spread Privacy
Spread Privacy
Engineering at Meta
Engineering at Meta
F
Fortinet All Blogs
酷 壳 – CoolShell
酷 壳 – CoolShell
Cyberwarzone
Cyberwarzone
The GitHub Blog
The GitHub Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
F
Full Disclosure
C
Cisco Blogs
Security Latest
Security Latest
T
The Exploit Database - CXSecurity.com
T
Tenable Blog
PCI Perspectives
PCI Perspectives
S
Security Affairs
Forbes - Security
Forbes - Security
Hugging Face - Blog
Hugging Face - Blog
C
CERT Recently Published Vulnerability Notes
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 聂微东
H
Hacker News: Front Page
S
Securelist
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
D
Darknet – Hacking Tools, Hacker News & Cyber Security
罗磊的独立博客
S
SegmentFault 最新的问题
C
Cyber Attacks, Cyber Crime and Cyber Security
The Hacker News
The Hacker News
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
S
Security @ Cisco Blogs
The Last Watchdog
The Last Watchdog
小众软件
小众软件
Hacker News - Newest:
Hacker News - Newest: "LLM"
Google DeepMind News
Google DeepMind News
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
IT之家
IT之家
Last Week in AI
Last Week in AI
爱范儿
爱范儿
AWS News Blog
AWS News Blog
MongoDB | Blog
MongoDB | Blog

博客园 - 不搽雪花膏

<!DOCTYPE>标签与table高度100% (转) linux运行apache出现403错误 Ubuntu 12.10 Tty (字符终端) 显示中文,和字体大小设置 64位系统下组件服务的查看 ActiveRecord返回部分字段的查询 转 Web前端性能优化全攻略 Castle ActiveRecord 笔记 - 不搽雪花膏 WQL测试工具 [转载]HttpModule与HttpHandler详解 转载 云计算七问七答 [转]整理.net程序集加载方法 MySQL(5.0)导出导入 .NET代码编写规范 Hibernate配置参数 [转]PKCS 证书 细数.net3.0的各项新特性 Jquery示例 Jquery入门 [转]Response.End、Response.Redirect 或 Server.Transfer 方法与 ThreadAbortException 异常
linux网关设置
不搽雪花膏 · 2013-12-11 · via 博客园 - 不搽雪花膏

1.linux中eth0为外网ip、外网网关、外网DNS设置,eth1为内网ip”172.22.0.0/16“不设置网关、DNS。

2.启动linux内核中的IP转发功能

执行vim命令编辑sysctl.conf文件:
vim /etc/sysctl.conf
使得:
net.ipv4.ip_forward = 1
重启网络:
/etc/init.d/network restart

3.配置iptables:将所有来自172.22.0.0/16的数据包的源ip地址为eth0网卡的ip:
iptables -t nat -A POSTROUTING -s 172.22.0.0/16 -o eth0 -j MASQUERADE
-t nat:指定要操作nat表
-A POSTROUTING:在源地址目标转换规则链末端添加一条规则
-s 172.22.0.0/16 : 指定要转换的数据包是172.22.0.0子网掩码为255.255.0.0的数据包
-o eth0 :匹配的数据包输出到网口eth0
-j MASQUERADE:数据包的源地址自动转换为出口网卡的ip