- 论坛徽章:
- 0
|
本帖最后由 blackboar 于 2015-04-27 21:44 编辑
如图上设置,理论上来说是比较简单的一个东西, 而且之前也是好的,今天手贱把防火墙重启下,结果就起不来了,报错如下:
iptables:应用防火墙规则:iptables-restore v1.4.7: Line4 seems to have a -t table option.
Error occurred at line: 4
Try `iptables-restore -h' or 'iptables-restore --help' for more information.
防火墙里的规则如下:
# Firewall configuration written by system-config-firewall
# Manual customization of this file is not recommended.
*nat
-A POSTROUTING -t nat -s 10.88.88.0/24 -o eth0 -j MASQUERADE
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 1723 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 47 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 1229 -j ACCEPT
#-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 25 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT
直接在终端执行iptables -t nat -A POSTROUTING -s 10.88.88.0/24 -o eth0 -j MASQUERADE 就不报错
执行完了以后通过iptables-save查看结果是:-A POSTROUTING -s 10.88.88.0/24 -o eth1 -j MASQUERADE
跟之前配置文件里对比就是少了 -t nat
后来直接在iptables里写-A POSTROUTING -s 10.88.88.0/24 -o eth1 -j MASQUERADE,然后启动不报错了,但是nat不能转发。
在pc上路由过去:
[e:\~]$ tracert 192.168.6.253
通过最多 30 个跃点跟踪到 192.168.6.253 的路由
1 <1 毫秒 <1 毫秒 <1 毫秒 192.168.1.1
2 * 41 ms 44 ms 10.88.88.1
3 10.88.88.1 报告: 无法访问目标主机。
server1上边的ipv4转发设置等等都没问题, -A POSTROUTING -s 10.88.88.0/24 -j SNAT --to-source 192.168.6.254 也写过没用。
望大家帮忙,多谢! |
|