Ik had een probleem met mijn fedora core 2 (kernel versie: 2.6.5-1.358) router, deze wilde wel eens moeilijk en vastlopen. Toen vanmorgen ik ook maar een snelheid van 20kb/s haalde (ipv 520) dacht ik schone install...
Zo gezegd zo gedaan....
Nu heb ik alles er weer op. alles werkt in principe ook. Alleen valt de sneleheid nadat de linux-pc 5min heeft aangestaan weer terug naar 20kb/s een reboot werkt dan. maar voor maar 5 min.
Ik dacht eerst dat het aan de cbq lag, is niet het geval -> uitgezet
firewall / routing script:
Geen zin op script te lezen, spring naar beneden
is erg groot, kan hem wel posten, maar denk niet dat het hieraan ligt.Maar wel handig
En dat was het script
Verder heb ik alle services uit proberen te zetten in de hoop dat dit werkt, ook dit is niet het geval.
Wat kan de oorzaak zijn?????
edit:
ping van www.home.nl als snelheid laag is:
64 bytes from www.home.nl (213.51.129.38): icmp_seq=5 ttl=251 time=863 ms
64 bytes from www.home.nl (213.51.129.38): icmp_seq=6 ttl=251 time=689 ms
64 bytes from www.home.nl (213.51.129.38): icmp_seq=7 ttl=251 time=523 ms
64 bytes from www.home.nl (213.51.129.38): icmp_seq=8 ttl=251 time=947 ms
is dus niet zo gek, de vraag is nu, waarom wordt die ping zo hoog?
Edit2:
als ik eth1 (intern) afsluit wordt de ping 'normaal' ~8ms
als ik hem weer aanzet loopt ie weer op.
Ik gebruik verder nog het programma dnsmasq (versie.2.23) om dns queries door te forwarden. Toen ik deze uitzette veranderde niets. Kan deze problemen veroorzaken oid?
Edit3:
fouten van firewall tijdens opstarten:
Oct 18 20:30:38 CC12729-A firewall-2.4: insmod: can't read 'ip_conntrack': No such file or directory
Oct 18 20:30:38 CC12729-A firewall-2.4: insmod: can't read 'ip_conntrack_ftp': No such file or directory
Oct 18 20:30:38 CC12729-A firewall-2.4: insmod: can't read 'ip_conntrack_irc': No such file or directory
Oct 18 20:30:38 CC12729-A firewall-2.4: insmod: can't read 'iptable_nat': No such file or directory
Oct 18 20:30:38 CC12729-A firewall-2.4: insmod: can't read 'ip_nat_ftp': No such file or directory
lijkt erop dat ik wat mis? nu ben ik niet zo goed met linux, maar hoe krijg in dit verholpen?
Ik heb nu het gevoel dat het of aan het firewall scriptje ligt, of dat er een route niet goed is waardoor de ping ontzettend hoog uitvalt. Als ik het firewall scriptje niet draai (dus met chkconfig uit boot gehaald) werkt ie wel (=goede snelheid @ linux pc / router), en als ik heb daarna met de hand aanzet doet ie het ook niet (brakke snelheid, hoge ping), oftewel mijn scriptje spoort niet.
Het vreemde is dus dat ik met dezelfde install een maand geleden nog 24/7 non stop werkte zonder fouten. Of heb ik iets niet goed gedaan?
Zo gezegd zo gedaan....
Nu heb ik alles er weer op. alles werkt in principe ook. Alleen valt de sneleheid nadat de linux-pc 5min heeft aangestaan weer terug naar 20kb/s een reboot werkt dan. maar voor maar 5 min.
Ik dacht eerst dat het aan de cbq lag, is niet het geval -> uitgezet
firewall / routing script:
Geen zin op script te lezen, spring naar beneden
is erg groot, kan hem wel posten, maar denk niet dat het hieraan ligt.Maar wel handig
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
| #!/bin/sh
#
# rc.firewall-2.4-stronger
FWVER=0.73s
echo -e "\nLoading STRONGER rc.firewall - version $FWVER..\n"
IPTABLES=/sbin/iptables
LSMOD=/sbin/lsmod
DEPMOD=/sbin/depmod
INSMOD=/sbin/insmod
GREP=/bin/grep
AWK=/bin/awk
SED=/bin/sed
IFCONFIG=/sbin/ifconfig
# EXTIF is internet, INTIF is LAN
EXTIF="eth0"
INTIF="eth1"
echo " External Interface: $EXTIF"
echo " Internal Interface: $INTIF"
echo " ---"
# Specify your Static IP address here or let the script take care of it
# for you.
#
# If you prefer to use STATIC addresses in your firewalls, un-# out the
# static example below and # out the dynamic line. If you don't care,
# just leave this section alone.
#
# If you have a DYNAMIC IP address, the ruleset already takes care of
# this for you. Please note that the different single and double quote
# characters and the script MATTER.
#
#
# DHCP users:
# -----------
# If you get your TCP/IP address via DHCP, **you will need ** to enable the
# #ed out command below underneath the PPP section AND replace the word
# "eth0" with the name of your EXTERNAL Internet connection (ppp0, ippp0,
# etc) on the lines for "ppp-ip" and "extip". You should also note that the
# DHCP server can and will change IP addresses on you. To deal with this,
# users should configure their DHCP client to re-run the rc.firewall ruleset
# everytime the DHCP lease is renewed.
#
# NOTE #1: Some DHCP clients like the original "pump" (the newer
# versions have been fixed) did NOT have the ability to run
# scripts after a lease-renew. Because of this, you need to
# replace it with something like "dhcpcd" or "dhclient".
#
# NOTE #2: The syntax for "dhcpcd" has changed in recent versions.
#
# Older versions used syntax like:
# dhcpcd -c /etc/rc.d/rc.firewall eth0
#
# Newer versions execute a file called /etc/dhcpc/dhcpcd-eth0.exe
#
# NOTE #3: For Pump users, put the following line in /etc/pump.conf:
#
# script /etc/rc.d/rc.firewall
#
# Determine the external IP automatically:
# ----------------------------------------
# ip adressen bepalen, external en internal
EXTIP="`$IFCONFIG $EXTIF | $GREP 'inet addr' | $AWK '{print $2}' | $SED -e 's/.*://'`"
echo " External IP: $EXTIP"
echo " ---"
# Assign the internal TCP/IP network and IP address
INTNET="192.168.12.0/24"
INTIP="192.168.12.200/24"
echo " Internal Network: $INTNET"
echo " Internal IP: $INTIP"
echo " ---"
# Setting a few other local variables
#
UNIVERSE="0.0.0.0/0"
#======================================================================
#== No editing beyond this line is required for initial MASQ testing ==
# Need to verify that all modules have all required dependencies
#
echo " - Verifying that all kernel modules are ok"
$DEPMOD -a
echo -en " Loading kernel modules: "
echo -en "ip_tables, "
if [ -z "` $LSMOD | $GREP ip_tables | $AWK {'print $1'} `" ]; then
$INSMOD ip_tables
fi
echo -en "ip_conntrack, "
if [ -z "` $LSMOD | $GREP ip_conntrack | $AWK {'print $1'} `" ]; then
$INSMOD ip_conntrack
fi
echo -e "ip_conntrack_ftp, "
if [ -z "` $LSMOD | $GREP ip_conntrack_ftp | $AWK {'print $1'} `" ]; then
$INSMOD ip_conntrack_ftp
fi
echo -en "ip_conntrack_irc, "
if [ -z "` $LSMOD | $GREP ip_conntrack_irc | $AWK {'print $1'} `" ]; then
$INSMOD ip_conntrack_irc
fi
echo -en "iptable_nat, "
if [ -z "` $LSMOD | $GREP iptable_nat | $AWK {'print $1'} `" ]; then
$INSMOD iptable_nat
fi
echo -e "ip_nat_ftp"
if [ -z "` $LSMOD | $GREP ip_nat_ftp | $AWK {'print $1'} `" ]; then
$INSMOD ip_nat_ftp
fi
echo " ---"
# Just to be complete, here is a list of the remaining kernel modules
# and their function. Please note that several modules should be only
# loaded by the correct master kernel module for proper operation.
# --------------------------------------------------------------------
#
# ipt_mark - this target marks a given packet for future action.
# This automatically loads the ipt_MARK module
#
# ipt_tcpmss - this target allows to manipulate the TCP MSS
# option for braindead remote firewalls.
# This automatically loads the ipt_TCPMSS module
#
# ipt_limit - this target allows for packets to be limited to
# to many hits per sec/min/hr
#
# ipt_multiport - this match allows for targets within a range
# of port numbers vs. listing each port individually
#
# ipt_state - this match allows to catch packets with various
# IP and TCP flags set/unset
#
# ipt_unclean - this match allows to catch packets that have invalid
# IP/TCP flags set
#
# iptable_filter - this module allows for packets to be DROPped,
# REJECTed, or LOGged. This module automatically
# loads the following modules:
#
# ipt_LOG - this target allows for packets to be
# logged
#
# ipt_REJECT - this target DROPs the packet and returns
# a configurable ICMP packet back to the
# sender.
#
# iptable_mangle - this target allows for packets to be manipulated
# for things like the TCPMSS option, etc.
#CRITICAL: Enable IP forwarding since it is disabled by default since
#
# Redhat Users: you may try changing the options in
# /etc/sysconfig/network from:
#
# FORWARD_IPV4=false
# to
# FORWARD_IPV4=true
#
echo " Enabling forwarding.."
echo "1" > /proc/sys/net/ipv4/ip_forward
echo " Enabling DynamicAddr.."
echo "1" > /proc/sys/net/ipv4/ip_dynaddr
echo " ---"
echo " Clearing any existing rules and setting default policy to DROP.."
$IPTABLES -P INPUT DROP
$IPTABLES -F INPUT
$IPTABLES -P OUTPUT DROP
$IPTABLES -F OUTPUT
$IPTABLES -P FORWARD DROP
$IPTABLES -F FORWARD
$IPTABLES -F -t nat
#Not needed and it will only load the unneeded kernel module
#$IPTABLES -F -t mangle
#
# Flush the user chain.. if it exists
if [ -n "`$IPTABLES -L | $GREP drop-and-log-it`" ]; then
$IPTABLES -F drop-and-log-it
fi
#
# Delete all User-specified chains
$IPTABLES -X
#
# Reset all IPTABLES counters
$IPTABLES -Z
#Configuring specific CHAINS for later use in the ruleset
echo " Creating a DROP chain.."
$IPTABLES -N drop-and-log-it
$IPTABLES -A drop-and-log-it -j LOG --log-level info
$IPTABLES -A drop-and-log-it -j DROP
echo -e "\n - Loading INPUT rulesets"
#######################################################################
# INPUT: Incoming traffic from various interfaces. All rulesets are
# already flushed and set to a default policy of DROP.
#
# loopback interfaces are valid.
#
$IPTABLES -A INPUT -i lo -s $UNIVERSE -d $UNIVERSE -j ACCEPT
# local interface, local machines, going anywhere is valid
#
$IPTABLES -A INPUT -i $INTIF -s $INTNET -d $UNIVERSE -j ACCEPT
# remote interface, claiming to be local machines, IP spoofing, get lost
#
$IPTABLES -A INPUT -i $EXTIF -s $INTNET -d $UNIVERSE -j drop-and-log-it
# external interface, from any source, for ICMP traffic is valid
#
# If you would like your machine to "ping" from the Internet,
# enable this next line
#
#$IPTABLES -A INPUT -i $EXTIF -p ICMP -s $UNIVERSE -d $EXTIP -j ACCEPT
# remote interface, any source, going to permanent PPP address is valid
#
#$IPTABLES -A INPUT -i $EXTIF -s $UNIVERSE -d $EXTIP -j ACCEPT
# Allow any related traffic coming back to the MASQ server in
#
$IPTABLES -A INPUT -i $EXTIF -s $UNIVERSE -d $EXTIP -m state --state \
ESTABLISHED,RELATED -j ACCEPT
# ----- Begin OPTIONAL Section -----
#
# DHCPd - Enable the following lines if you run an INTERNAL DHCPd server
#
$IPTABLES -A INPUT -i $INTIF -p tcp --sport 68 --dport 67 -j ACCEPT
$IPTABLES -A INPUT -i $INTIF -p udp --sport 68 --dport 67 -j ACCEPT
# HTTPd - Enable the following lines if you run an EXTERNAL WWW server
#
echo -e " - Allowing EXTERNAL access to the WWW server on port 7890/4890"
$IPTABLES -A INPUT -i $EXTIF -m state --state NEW,ESTABLISHED,RELATED -p tcp -s $UNIVERSE -d $EXTIP --dport 7890 -j ACCEPT
$IPTABLES -A INPUT -i $EXTIF -m state --state NEW,ESTABLISHED,RELATED -p tcp -s $UNIVERSE -d $EXTIP --dport 4890 -j ACCEPT
#
# ----- End OPTIONAL Section -----
# Catch all rule, all other incoming is denied and logged.
#
$IPTABLES -A INPUT -s $UNIVERSE -d $UNIVERSE -j drop-and-log-it
echo -e " - Loading OUTPUT rulesets"
#######################################################################
# OUTPUT: Outgoing traffic from various interfaces. All rulesets are
# already flushed and set to a default policy of DROP.
#
# loopback interface is valid.
#
$IPTABLES -A OUTPUT -o lo -s $UNIVERSE -d $UNIVERSE -j ACCEPT
# local interfaces, any source going to local net is valid
#
$IPTABLES -A OUTPUT -o $INTIF -s $EXTIP -d $INTNET -j ACCEPT
# local interface, any source going to local net is valid
#
$IPTABLES -A OUTPUT -o $INTIF -s $INTIP -d $INTNET -j ACCEPT
# outgoing to local net on remote interface, stuffed routing, deny
#
$IPTABLES -A OUTPUT -o $EXTIF -s $UNIVERSE -d $INTNET -j drop-and-log-it
# anything else outgoing on remote interface is valid
#
$IPTABLES -A OUTPUT -o $EXTIF -s $EXTIP -d $UNIVERSE -j ACCEPT
# ----- Begin OPTIONAL Section -----
#
# DHCPd - Enable the following lines if you run an INTERNAL DHCPd server
#
$IPTABLES -A OUTPUT -o $INTIF -p tcp -s $INTIP --sport 67 -d 255.255.255.255 --dport 68 -j ACCEPT
$IPTABLES -A OUTPUT -o $INTIF -p udp -s $INTIP --sport 67 -d 255.255.255.255 --dport 68 -j ACCEPT
#
# ----- End OPTIONAL Section -----
# Catch all rule, all other outgoing is denied and logged.
#
$IPTABLES -A OUTPUT -s $UNIVERSE -d $UNIVERSE -j drop-and-log-it
echo -e " - Loading FORWARD rulesets"
#######################################################################
# FORWARD: Enable Forwarding and thus IPMASQ
#
echo " - FWD: Allow all connections OUT and only existing/related IN"
$IPTABLES -A FORWARD -i $EXTIF -o $INTIF -m state --state ESTABLISHED,RELATED \
-j ACCEPT
$IPTABLES -A FORWARD -i $INTIF -o $EXTIF -j ACCEPT
# Catch all rule, all other forwarding is denied and logged.
#
$IPTABLES -A FORWARD -j drop-and-log-it
echo " - NAT: Enabling SNAT (MASQUERADE) functionality on $EXTIF"
#
#More liberal form
#$IPTABLES -t nat -A POSTROUTING -o $EXTIF -j MASQUERADE
#
#Stricter form
$IPTABLES -t nat -A POSTROUTING -o $EXTIF -j SNAT --to $EXTIP
#######################################################################
echo " - Enabling port blocking on $EXTIF"
$IPTABLES -A INPUT -p tcp -i $EXTIF --destination-port 80 -j REJECT
$IPTABLES -A INPUT -p tcp -i $EXTIF --destination-port 22 -j REJECT
$IPTABLES -A INPUT -p tcp -i $EXTIF --destination-port 111 -j REJECT
$IPTABLES -A INPUT -p tcp -i $EXTIF --destination-port 443 -j REJECT
$IPTABLES -A INPUT -p tcp -i $EXTIF --destination-port 1024 -j REJECT
$IPTABLES -A INPUT -p tcp -i $EXTIF --destination-port 3306 -j REJECT
$IPTABLES -A INPUT -p tcp -i $EXTIF --destination-port 6000 -j REJECT
$IPTABLES -A INPUT -p tcp -i $EXTIF --destination-port 199 -j REJECT
echo " - Enabling port forwarding for use with the WWW server"
#webserver op 4890, extern 7890, intern 80
$IPTABLES -t nat -A PREROUTING -i $INTIF -d 192.168.12.200 -p tcp --dport 80 -j REDIRECT --to-port 4890
$IPTABLES -t nat -A PREROUTING -i $EXTIF -p tcp --dport 7890 -j REDIRECT --to-port 4890
#nfs:u
$IPTABLES -t nat -A PREROUTING -i $EXTIF -p udp --dport 3658:3659 -j DNAT --to-dest 192.168.12.13
$IPTABLES -t nat -A PREROUTING -i $EXTIF -p tcp --dport 10900:10999 -j DNAT --to-dest 192.168.12.13
$IPTABLES -A FORWARD -p udp -i $EXTIF --dport 3658:3659 -d 192.168.12.13 -j ACCEPT
$IPTABLES -A FORWARD -p tcp -i $EXTIF --dport 10900:10999 -d 192.168.12.13 -j ACCEPT
echo -e "\nStronger rc.firewall-2.4 $FWVER done.\n" |
En dat was het script
Verder heb ik alle services uit proberen te zetten in de hoop dat dit werkt, ook dit is niet het geval.
Wat kan de oorzaak zijn?????
edit:
ping van www.home.nl als snelheid laag is:
64 bytes from www.home.nl (213.51.129.38): icmp_seq=5 ttl=251 time=863 ms
64 bytes from www.home.nl (213.51.129.38): icmp_seq=6 ttl=251 time=689 ms
64 bytes from www.home.nl (213.51.129.38): icmp_seq=7 ttl=251 time=523 ms
64 bytes from www.home.nl (213.51.129.38): icmp_seq=8 ttl=251 time=947 ms
is dus niet zo gek, de vraag is nu, waarom wordt die ping zo hoog?
Edit2:
als ik eth1 (intern) afsluit wordt de ping 'normaal' ~8ms
als ik hem weer aanzet loopt ie weer op.
Ik gebruik verder nog het programma dnsmasq (versie.2.23) om dns queries door te forwarden. Toen ik deze uitzette veranderde niets. Kan deze problemen veroorzaken oid?
Edit3:
fouten van firewall tijdens opstarten:
Oct 18 20:30:38 CC12729-A firewall-2.4: insmod: can't read 'ip_conntrack': No such file or directory
Oct 18 20:30:38 CC12729-A firewall-2.4: insmod: can't read 'ip_conntrack_ftp': No such file or directory
Oct 18 20:30:38 CC12729-A firewall-2.4: insmod: can't read 'ip_conntrack_irc': No such file or directory
Oct 18 20:30:38 CC12729-A firewall-2.4: insmod: can't read 'iptable_nat': No such file or directory
Oct 18 20:30:38 CC12729-A firewall-2.4: insmod: can't read 'ip_nat_ftp': No such file or directory
lijkt erop dat ik wat mis? nu ben ik niet zo goed met linux, maar hoe krijg in dit verholpen?
Ik heb nu het gevoel dat het of aan het firewall scriptje ligt, of dat er een route niet goed is waardoor de ping ontzettend hoog uitvalt. Als ik het firewall scriptje niet draai (dus met chkconfig uit boot gehaald) werkt ie wel (=goede snelheid @ linux pc / router), en als ik heb daarna met de hand aanzet doet ie het ook niet (brakke snelheid, hoge ping), oftewel mijn scriptje spoort niet.
Het vreemde is dus dat ik met dezelfde install een maand geleden nog 24/7 non stop werkte zonder fouten. Of heb ik iets niet goed gedaan?
[ Voor 178% gewijzigd door elgringo op 18-10-2005 22:01 ]
if broken it is, fix it you should