PDA

Bekijk de volledige versie : Beginners mistakes



Freelancer
29-07-2007, 15:54
Hi, There

After fighting two days to set up my router to work decided to write about the mistakes that I made during installation.

The Hard Disk partition.

I hade a big hard disk. I partitioned the first time as r0kanon said.
http://wl500g.info/showthread.php?t=6222

2 partitions:
1st small boot.
2nd the rest.

But I just could not get transmission work.
I suspected the that I could not configure transmission so I thought of making a three partition system so that I can mount the 3rd partition to /tmp/harddisk/

Than I went for Moody Blue guide:
http://wl500g.info/showthread.php?t=5909&page=3

This also did not worked out because my the router kept on out mounting the first boot partition to the /tmp/harddisk/
In the /tmp/harddisk/ I used to have two mounted partitions. System mounted the boot partition and I mounted the 3rd. Could not unmount the boot. This did not worked out.

So I thought maybe I’ll go for marcnesium way because if the system auto mounts the first drive than it will mount my big storage partition.
http://wl500g.info/showthread.php?t=5909

So I put the small boot partition in the back. But now I do not know why but the system did not did the auto mount.
But that was not a problem, because I mounted twice and that worked fine. :)



nano /usr/local/sbin/post-boot





#!/bin/sh

# test if USB disc has been attached
# if not - then insert needed modules
if [ ! -d /dev/discs ]
then
insmod scsi_mod && insmod sd_mod && insmod usb-storage && sleep 5s
fi

# Wait for /opt to mount
mount /dev/discs/disc0/part1 /opt
mount /dev/discs/disc0/part1 /tmp/harddisk
i=0
while [ $i -le 30 ]
do
if [ -d /opt/etc ]
then
break
fi
sleep 1
i=`expr $i + 1`
done

# Activate swap
swapon /dev/discs/disc0/part2

# Set hostname
hostname my.router

# Synchoronize time
# For GMT time zone you would want to:
echo "GMT+0BST-1,M3.5.0/01:00:00,M10.5.0/02:00:00" > /etc/TZ && sleep 2s
# Then ntpclient can update the time correctly
ntpclient -l -h 0.uk.pool.ntp.org -c 1 -s

# Run all active services - active means starts with S
# SAMBA will be started from there if you have follow marcnesium's instructions
/opt/etc/init.d/rc.unslung

Freelancer
29-07-2007, 16:06
My second big mistake was the /opt/etc/init.d/rc.unslung
Oh, boy, I kept on doing every configuration Till I realized that rc.unslung needs to be created and written right after mounting the data drive.
rc.unslung is the file that executes the startup configs from the
/opt/etc/init.d/ directory. (S05syslogd, S10cron, S80busybox_httpd, S97Samba)
Kept on writing those files and did not realize that they are not working.
Man, and marcnesium, r0kanon, Moody Blue they never speek about this in their tutorial. If they read this than they shoud update.

wengi wrote how the file should look:
http://wl500g.info/showthread.php?t=9477&highlight=rc.unslung

So in marcnesium tutorial before
Initiate ipkg and install nano, screen, midnight commander (or in between)
make sure that you create rc.unslung.
See wengi's post

Freelancer
02-03-2008, 13:54
An other mistake that I made was when I copy pasted the various config files.
I did not noticed that one of the comment lines ended in the new row.
like this:



#This is very long comment line and here is carried return
and this is a new line and it interprets it like a code line.


I kept on getting the:
"Unable to find recent transfer stats in syslog"
error line on my transmission and simply could not figure what is wrong.

I found the error accidentally.
As I was browsing trough my config files with the Midnight Commander F3 editor which gave highlight I noticed, hey that is not good.
So my advice is as you configured all look, with the colorful Midnight Commander at your config files and review them if they are okey. Do not use the black and white Midnight commander or other editor because that is not good.

Freelancer
06-04-2009, 21:28
I just fucked up the post-firewall from the beginning and only now I realized my mistake.
This costed me a lot of ratio.
The situation is that you need to open up both TCP and IP so that you became an active torrenter and not a passive one.
I used to have:



# Allow access to various router services from WAN
for P in 22 65534; do
iptables -I INPUT 1 -p tcp --syn -i "$1" --dport $P -j ACCEPT
done

This opened up only TCP and I was not an active torrenter so only actives were able to download from me...
No passive guys.

To become an active I opened up the IP too.
Like this:


## also open the old stuff
iptables -I INPUT 1 -p tcp --syn -i "$1" --dport 65534 -j ACCEPT
iptables -I INPUT 1 -p udp --syn -i "$1" --dport 65534 -j ACCEPT


Now my post firewall looks like this:



#!/bin/sh
## FIREWALL
## set default policy
iptables -P INPUT DROP
## deny ftp access from WAN
iptables -I INPUT 1 -p tcp -i "$1" --syn --dport 21 -j DROP

#Old stuff.
## Allow access to various router services from WAN
#for P in 22 65534; do
# iptables -I INPUT 1 -p tcp --syn -i "$1" --dport $P -j ACCEPT
#done

#New stuff
## open 51413 for torrent
iptables -I INPUT 1 -p tcp --syn -i "$1" --dport 51413 -j ACCEPT
iptables -I INPUT 1 -p udp --syn -i "$1" --dport 51413 -j ACCEPT

## also open the old stuff
iptables -I INPUT 1 -p tcp --syn -i "$1" --dport 65534 -j ACCEPT
iptables -I INPUT 1 -p udp --syn -i "$1" --dport 65534 -j ACCEPT


You can check if you are an active at torrent sites if it list you connectible.

DrChair
08-04-2009, 19:37
for P in 22 65534; do
iptables -I INPUT 1 -p tcp --syn -i "$1" --dport $P -j ACCEPT
done

this seems to be anyway a terrible solution. You open almost all ports, so it's equivalent of switching off firewall. Plus you do it in a very stupid way --- by adding 65K rules. After that was your internet working at all? I think it should result in a considerable slowdown.

for P in 22 65534 => it is executed for 22 and for 65534. Not for 22 till 65534.
So actually it's quite elegant...

al37919
08-04-2009, 22:24
hm, really... I think you are right. Sorry for the misleading statement.