打印

RH8怎么设置共享上网?

RH8怎么设置共享上网?

机器上有两块网卡,一块连接外部网(宽带接入),另一块连接局域网。在WIN2000中设置外网连接共享就好了,RH8怎么搞?
天行健,君子以自强不息

TOP

用iptables做一个IP伪装即可,
iptables -t nat -A POSTROUTING -o eth1 -j SNAT --to 你的外网IP
然后, echo 1 > /proc/sys/net/ipv4/ip_forward
eth1是联接外网的网卡, eth0是联接内网的网卡, 其他机器把eth0作为网关即可实现共享上网

TOP

[quote:99b300610a="tsxht"]用iptables做一个IP伪装即可,
iptables -t nat -A POSTROUTING -o eth1 -j SNAT --to 你的外网IP
[/quote]

若你的 外网 IP 不是 固定的,那不是很麻烦?

按照我“置顶”的也可以的。


       高举马列主义毛泽东思想 !!!

TOP

我在没打开防火墙的情况下,服务器拼外部IP拼得通,拼内部的不通,是怎么回事,

TOP

现在都通了,是网卡的问题,但我的透明代理怎么也配置不好,我是把命令写进/etc/rc.d/rc.local,文件内容如下:
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local
modprobe ip_table
modprobe iptable_nat
insmod ip_conntrack_ftp
insmod ip_nat_ftp
insmod ip_conntrack_irc
insmod ip_nat_irc
iptables -A OUTPUT -o lo -j ACCEPT
iptables -A OUTPUT -o eth1 -j ACCEPT
iptables -t nat -A POSTROUTING -o eth1 -s 10.10.10.0/24 -j MASQUERADE
请问我配置的有问题吗

TOP