求iptables的一个简单应用[NAT]

由 elico_yqf 在 07-06-2004 18:54 发表:

求iptables的一个简单应用[NAT]

公司的一台rh7.3 linux防火墙因断电后崩溃掉了,重启后出现kernel panic....\\

没办法后来只好重装上了rh as3,现在就有这个问题不会写iptables,其实我以前看过,但不是很懂的。翻了一下精华区,感觉有很多是说这个NAT的,但好像又太过于复杂了吧,我就只想实现这个:

[外网]

|

[eth1][ip:1.2.3.4]

[linux主机]

[eth0][ip:5.6.7.8]

|

[内网]

现在就需要用iptables做个NAT,让内网的用户可以上网,其它没什么要求

现在就只好上网来找兄弟们帮忙了。

先行谢过了。。。


只喜欢简单一点的linux!

仅此而已!


由 faint 在 07-06-2004 19:59 发表:


echo "1" > /proc/sys/net/ipv4/ip_forward

iptables -t nat -A POSTROUTING -o eth1 -s 5.6.7.8/24 -j SNAT --to-source 1.2.3.4


由 smile787 在 07-06-2004 20:26 发表:


兄弟真的是够简单的了!!!

什么防火墙都没挂。。。要小心哦!

一丝不挂的小企鹅。。。喜欢。。。


由 faint 在 07-06-2004 20:31 发表:


先从简单的开始。然后再搞复杂的。:-)


由 smile787 在 07-06-2004 21:20 发表:


谈恋爱都还得出勾肩,拉手的什么开始,然后才能那。。。。。。。。。。。


由 Snoopy 在 07-07-2004 01:18 发表:


哈哈,,,

http://211.93.98.22/bbs/showthread....threadid=122267

看这里的防火墙,加些规则上去安全点吧


And then in the evening light, when the bars of freedom fall

I watch the two of you in the shadows on the wall

How in the darkness steals some of the choices from my hand

Then will I begin to under


由 wenwei99 在 07-07-2004 14:47 发表:


echo "1">/proc/sys/net/ipv4/ip_forward

echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_all

modprobe ip_tables

modprobe ip_nat_ftp

modprobe ip_nat_irc

modprobe ip_conntrack

modprobe ip_conntrack_ftp

modprobe ip_conntrack_irc

/sbin/ip

Published At
Categories with 服务器类
Tagged with
comments powered by Disqus