使用openswan 建立ipsec vpn 经验总结(续一)
作者 佚名技术
来源 Linux系统
浏览
发布时间 2012-05-14
上回说道找到问题的症结所在,是硬件的问题,不买关子了------------是网卡的问题.
服务器“假死”中,出项的iptables输出报错,网卡自动shutdown等.....,都是由网卡的问题引起的.![]() 23:24:44 up 7 days, 13:50, 1 user, load average: 0.00, 0.00, 0.00 [root@RServer ~]# ipsec look RServer Wed Aug 13 23:25:03 CST 2008 Destination Gateway Genmask Flags MSS Window irtt Iface 0.0.0.0 xx.xx.xx.xx 0.0.0.0 UG 0 0 0 eth0 10.1.1.0 xx.xx.xx.xx 255.255.255.0 UG 0 0 0 eth0 xxx.xxx.xxx.xxx 0.0.0.0 255.255.255.248 U 0 0 0 eth0 下面就要说说对应的iptables的设置了,(os是redhat 4.4 采用的系统自带的iptables,为进行重新编译) 使用iptables的shell脚本方式,这得谢谢和我合作配置ipsec vpn的对端的那位同仁了. 经实际运行,不断优化如下:( 注意请增加 iptables.sh 的执行权限,并放到 /etc/rc.d/rc.local 中以便于开机执行,再确认iptables服务也是开机运行的) 请注意windows 和 linux 不同字符换行等问题,建议最好自己在 vi 中手动输入. echo "1" >/proc/sys/net/ipv4/ip_forward modprobe ip_tables modprobe iptable_filter modprobe iptable_nat modprobe ip_conntrack modprobe ip_conntrack_ftp modprobe ip_nat_ftp #----------------------------------------------------------- EXT_IF="eth1" INT_IF="eth0" EXT_IP="xx.xx.xx.xx" 本地公网ip INT_IP="10.1.2.1" #----------------------------------------------------------- iptables -F -t filter iptables -X -t filter iptables -Z -t filter iptables -F -t nat iptables -X -t nat iptables -Z -t nat #----------------------------------------------------------- iptables -P INPUT DROP iptables -P FORWARD DROP iptables -P OUTPUT ACCEPT iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT #----------------------------------------------------------- iptables -A INPUT -i lo -j ACCEPT iptables -A OUTPUT -o lo -j ACCEPT iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT #--------------------deny (allow) ping from internet-------- iptables -A INPUT -p icmp -j ACCEPT #------for VPN iptables -A INPUT -s xx.xx.xx.xx -j ACCEPT 对端外网卡配置的公网地址允许 iptables -A INPUT -s 10.1.1.0/24 -j |
凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢! |
你可能对下面的文章感兴趣
关于使用openswan 建立ipsec vpn 经验总结(续一)的所有评论