歡迎您光臨本站 註冊首頁

adsl和iptables的問題

←手機掃碼閱讀     火星人 @ 2014-03-05 , reply:0

adsl和iptables的問題

前題是ADSL拔號能上網了。
一、腳本放在了/bin/adsl-go
內容是
#!/bin/bash
echo "Starting iptables rules ......."
adsl-stop
adsl-start
route add default ppp0
echo "1" > /proc/sys/net/ipv4/ip_forward
iptables -F
iptables -t nat -F
/sbin/depmod -a
/sbin/modprobe ip_tables
/sbin/modprobe iptable_nat
/sbin/modprobe ip_nat_ftp
/sbin/modprobe ipt_LOG
iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -j MASQUERADE
二、區域網出現的問題是
ping www.baidu.com -t 之後是
百分之五不通

三、LOG的錯誤信息是
ct 24 10:20:02 localhost crond(pam_unix): session closed for user root
Oct 24 10:20:02 localhost crond(pam_unix): session closed for user root
Oct 24 10:22:25 localhost sshd(pam_unix): session opened for user root by root(uid=0)
Oct 24 10:25:01 localhost crond(pam_unix): session opened for user root by (uid=0)
Oct 24 10:25:01 localhost crond(pam_unix): session closed for user root
Oct 24 10:30:01 localhost crond(pam_unix): session opened for user root by (uid=0)
Oct 24 10:30:01 localhost crond(pam_unix): session opened for user root by (uid=0)
Oct 24 10:30:01 localhost crond(pam_unix): session closed for user root
Oct 24 10:30:02 localhost crond(pam_unix): session closed for user root
Oct 24 10:35:01 localhost crond(pam_unix): session opened for user root by (uid=0)
Oct 24 10:35:01 localhost crond(pam_unix): session closed for user root
Oct 24 10:40:01 localhost crond(pam_unix): session opened for user root by (uid=0)
Oct 24 10:40:01 localhost crond(pam_unix): session opened for user root by (uid=0)
Oct 24 10:40:01 localhost crond(pam_unix): session closed for user root
Oct 24 10:40:01 localhost crond(pam_unix): session closed for user root
各位請指點一下問題在什麼地方!
《解決方案》

adsl和iptables上網

在自個做的網關上ping 外網沒有不通的現象!
就區域網內的PC機上有ping不通的現象。
《解決方案》

crond 里是不是每 5 分鐘跑了個什麼東西?
貼一下下列信息

# uname -a
# free
# sysctl -a|grep estab
# sysctl -a|grep max
# wc -l /proc/net/ip_conntrack
# cat /proc/cpuinfo
《解決方案》

多謝您的熱心幫助

現在這個Linux是做為客戶端的情況下執行的以下命令
# uname -a
Linux localhost.localdomain 2.6.9-5.ELsmp #1 SMP Wed Jan 5 19:30:39 EST 2005 i686 i686 i386 GNU/Linux
# free
             total       used       free     shared    buffers     cached
Mem:       1033172     194608     838564          0      41684      74536
-/+ buffers/cache:      78388     954784
Swap:      1020116          0    1020116
# sysctl -a|grep estab
error: unknown error 22 reading key 'net.ipv6.route.flush'
net.ipv4.netfilter.ip_conntrack_tcp_timeout_established = 432000
error: unknown error 22 reading key 'net.ipv4.route.flush'
error: unknown error 22 reading key 'fs.binfmt_misc.register'
# sysctl -a|grep max
dev.raid.speed_limit_max = 200000
dev.rtc.max-user-freq = 64
net.ipv6.conf.eth1.max_addresses = 16
net.ipv6.conf.eth1.max_desync_factor = 600
net.ipv6.conf.eth1.regen_max_retry = 5
net.ipv6.conf.lo.max_addresses = 16
net.ipv6.conf.lo.max_desync_factor = 600
net.ipv6.conf.lo.regen_max_retry = 5
net.ipv6.conf.default.max_addresses = 16
net.ipv6.conf.default.max_desync_factor = 600
net.ipv6.conf.default.regen_max_retry = 5
net.ipv6.conf.all.max_addresses = 16
net.ipv6.conf.all.max_desync_factor = 600
net.ipv6.conf.all.regen_max_retry = 5
net.ipv6.conf.eth0.max_addresses = 16
net.ipv6.conf.eth0.max_desync_factor = 600
net.ipv6.conf.eth0.regen_max_retry = 5
error: unknown error 22 reading key 'net.ipv6.route.flush'
net.ipv6.mld_max_msf = 10
net.ipv6.route.max_size = 4096
net.unix.max_dgram_qlen = 10
net.ipv4.ip_conntrack_max = 65472
net.ipv4.netfilter.ip_conntrack_tcp_max_retrans = 3
net.ipv4.netfilter.ip_conntrack_tcp_timeout_max_retrans = 300
net.ipv4.netfilter.ip_conntrack_max = 65472
error: unknown error 22 reading key 'net.ipv4.route.flush'
net.ipv4.inet_peer_gc_maxtime = 120
net.ipv4.inet_peer_maxttl = 600
net.ipv4.igmp_max_msf = 10
net.ipv4.igmp_max_memberships = 20
net.ipv4.route.max_size = 65536
net.ipv4.route.max_delay = 10
net.ipv4.tcp_max_syn_backlog = 1024
net.ipv4.tcp_max_tw_buckets = 180000
net.ipv4.tcp_max_orphans = 32768
error: unknown error 22 reading key 'fs.binfmt_misc.register'
net.core.somaxconn = 128
net.core.optmem_max = 10240
net.core.netdev_max_backlog = 300
net.core.rmem_max = 262144
net.core.wmem_max = 262144
vm.max_map_count = 65536
kernel.ngroups_max = 65536
kernel.pid_max = 32768
kernel.pty.max = 4096
kernel.threads-max = 32736
kernel.msgmax = 8192
kernel.shmmax = 2147483648
fs.mqueue.msgsize_max = 8192
fs.mqueue.msg_max = 10
fs.mqueue.queues_max = 256
fs.aio-max-nr = 65536
fs.file-max = 65536
# wc -l /proc/net/ip_conntrack
46 /proc/net/ip_conntrack
# cat /proc/cpuinfo
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 15
model           : 4
model name      : Intel(R) Pentium(R) 4 CPU 3.06GHz
stepping        : 9
cpu MHz         : 3059.256
cache size      : 1024 KB
physical id     : 0
siblings        : 2
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 5
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm pni monitor ds_cpl tm2 cid xtpr
bogomips        : 6029.31

processor       : 1
vendor_id       : GenuineIntel
cpu family      : 15
model           : 4
model name      : Intel(R) Pentium(R) 4 CPU 3.06GHz
stepping        : 9
cpu MHz         : 3059.256
cache size      : 1024 KB
physical id     : 0
siblings        : 2
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 5
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm pni monitor ds_cpl tm2 cid xtpr
bogomips        : 6111.23

#
《解決方案》

沒道理會丟包啊,ping 別的地址試試,比如 Linux 的下一跳
《解決方案》

什麼意思!ping別的網址嗎? 把我加上好啊!MSN
《解決方案》

問題還沒有解決!請各位高手繼續給指點,問題的可能究竟在什麼地方。為什麼他會丟包呢!網關不丟,這肯定是在做轉化上了!也請班主和大俠幫幫小弟!
《解決方案》

為什麼沒有人離我呢!是不是我的用SQUID和IPTABLES來完成上網的任務啊!
還是請各位高手,我點播的一下吧!
感謝!感謝!
《解決方案》

班主應該積極點嗎!我看也.....................................................................................................................................................................................................................................................................................
  :(   :(   :(
《解決方案》

各位仁兄!百忙之中看看我的問題在哪啊?班主各我這個菜LINUX指點指點?

[火星人 ] adsl和iptables的問題已經有620次圍觀

http://coctec.com/docs/service/show-post-44354.html