|
买了个centos5.5的vps ,vps内虚拟网卡分别是lo、venet0和venet0:0, 提供商把ip绑在venet0:0上面,现在我要加点规则限制一下外网过来的访问,修改/etc/sysconfig/iptables只留以下几条规则:
*filter
:INPUT DROP
:OUTPUT ACCEPT
-A INPUT -i ! venet0:0 -j ACCEPT
-A INPUT -i venet0:0 -p tcp --dport 22 -j ACCEPT
-A INPUT -i venet0:0 -p tcp --dport 22345 -j ACCEPT
-A INPUT -i venet0:0 -p tcp --dport 80 -j ACCEPT
-A INPUT -i venet0:0 -p udp --sport 53 -j ACCEPT
-A INPUT -i venet0:0 -p icmp -j ACCEPT
COMMIT
加了后用service iptables restart启动时报错:
Applying iptables firewall rules: Warning: wierd character in interface `venet0-0' (No aliases, :, !
or *).
Warning: wierd character in interface `venet0-0' (No aliases, :, ! or *).
Warning: wierd character in interface `venet0-0' (No aliases, :, ! or *).
Warning: wierd character in interface `venet0-0' (No aliases, :, ! or *).
Warning: wierd character in interface `venet0-0' (No aliases, :, ! or *).
Warning: wierd character in interface `venet0-0' (No aliases, :, ! or *).
又把venet0:0换成venet0-1也是一样的错误,请指教!
补充: 后来进/etc/sysconfig/network-script中把ifcfg-venet0:0改成ifcfg-eth0后,重启venet0:0又出现了,使用ifconfig看到ifcfg-eth0没有启用。 |
|