|
环境:rhad_server21,单网卡绑定两个ip,eth0:0为外网地址为192.168.8.1,gateway为192.168.8.168,可以上外网;eth0为内网,地址为192.168.1.1
我的iptables:
iptables -F
iptables -t nat -F
iptables -P FORWARD DROP
iptables -P INPUT DROP
iptables -P OUTPUT DROP
iptables -t nat -P PREROUTING DROP
iptables -t nat -P POSTROUTING DROP
iptables -t nat- P OUTPUT DROP
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -A OUTPUT -p all -o eth0 -j ACCEPT
iptables -A INPUT -p all eth0 -j ACCEPT
iptables -t nat -A PREROUTING -p icmp -s 192.168.1.1 -d 0/0 -j ACCEPT
iptables -t nat -A POSTROUTING -p all -o eth0 -j ACCEPT
iptables -t nat -A OUTPUT -p all -o eth0 -j ACCEPT
外网走192.168.8.1可以ping通,可以上网浏览!就是不知道为什么ping 192.168.1.1(本机)就ping 不通
ping 192.168.1.1 (192.168.1.1) from 192.168.1.1 : 56(84) bytes of data.
ping: sendto: Operatinon not permitted
|
|