- 论坛徽章:
- 0
|
各位大侠:
本人希望做一个外网地址IP到内网主机地址映射。
外网段为10.100.0.0/16
内网段为20.100.0.0/16
希望外网段客户在寻地址为10.100.18.100的主机时,iptables防
火墙能够将该地址映射到20.100.100.100的主机上。
iptables防火墙配置 外网卡eth1 : 10.100.18.5/16
内网卡eth1 : 20.100.100.254/16
本人在防火墙配置外网卡eth1 绑定地址10.100.18.100,
进行如下操作:
# modprobe ip_tables
# modprobe ip_nat_ftp
#ifconfig eth1 add 10.100.18.100 netmask 255.255.0.0
配置iptables:
iptables -F
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -A INPUT -j ACCEPT
iptables -A OUTPUT -j ACCEPT
iptables -A FORWARD -s 0/0 -d 0/0 -j ACCEPT
iptables -t nat -A PREROUTING -i eth1 -d 10.100.18.100 -j
DNAT --to 20.100.100.100
iptables -t nat -A POSTROUTING -o eth1 -s 20.100.100.100 -j
SNAT --to 10.100.18.100
iptables -A FORWARD -j DROP
但是,在10.100.0.0/16子网内telnet主机 10.100.18.100时登陆的却是防火墙主机,不是20.100.100.100主机。
我的iptables是在redhat 7.3安装过程中选中的。是否需要下在下载iptables二进文件重新编译,选择NAT后重新编译才成?
各位大侠请帮忙! |
|