PDA

Bekijk de volledige versie : Webserver Instructions Fails Of Alpha5 (rookie)



Satleecher
30-03-2005, 19:29
I am a patcher, poker, overclocker, firmware freak. So I would like to have the webserver on port80 over WAN. I upgraded tot 1.9.2.7-CR4 and followed alpha5 steps. I use hyperterminal as telnet client. I can log in and get responses of busybox, but at the first command line I get an error:

mkdir /tmp/usbmount/web

-> response:

[admin@(none) root]$ mkdir /tmp/usbmount/web

mkdir: Cannot create directory `/tmp/usbmount/web': No such file or directory

What do I do wrong? Thanks for helping out. So I get the optimum output of the WL-500g.

:confused: Andre :confused:

Jean-Fabrice
30-03-2005, 19:36
have you tried 'mkdir -p /tmp/usbmount/web' ?

=> 'man mkdir' on google ;)

Satleecher
30-03-2005, 19:58
have you tried 'mkdir -p /tmp/usbmount/web' ?

=> 'man mkdir' on google ;)


This did work (at least no error). But next line of Alpha instructions again an error:

[admin@(none) root]$ touch /usr/local/sbin/post-firewall
touch: /usr/local/sbin/post-firewall: No such file or directory

FORGET THIS REMARK: TOUCH does work after creating the folders with the
-p option. Now I have to get into vi modes. I succeeded but not to get the codes in. I will download a real telnet client i.s.o. the hyperterminal.

Andre

Jean-Fabrice
30-03-2005, 20:07
You see I am a real rookie....
you didn't seem to be...

Read carefully http://wl500g.dyndns.org/. Many answers are in for tweaking, pathing and poking fw

Satleecher
30-03-2005, 20:33
:D :) :D :) :cool: [QUOTE=Jean-Fabrice]you didn't seem to be...

Yes I am....

[LABEL= SQUARE ONE]

[admin@(none) root]$ cat /usr/local/sbin/post-boot/
cat: Read error: Is a directory

Did 'vi' save the file or do I make an error?: What did I do? -->

After entering vi mode, then I see a kind of window with
~
~
~
etc. in it.

Then I past the [CODE]
mount /dev/discs/disc0/part1 /tmp/harddisk -t vfat
busybox_httpd -p 81 -h /tmp/harddisk/web[CODE]

but I see :

ODE]
mount /dev/discs/disc0/part1 /tmp/harddisk -t vfat
busybox_httpd -p 81 -h /tmp/harddisk/web[CODE]

Then I move with cursor to first line and add [C to get:

[CODE]
mount /dev/discs/disc0/part1 /tmp/harddisk -t vfat
busybox_httpd -p 81 -h /tmp/harddisk/web[CODE]

Then I move to end of the whole section and press ESC
and type in :wq! and return

Result: nothing happens. I try to get out of vi mode by pressing CTRL+Z then I get a remark of ' + CPU time limit exceeded vi /usr/local/sbin/post-boot

and I am back at square one (see the label of the beginning of this email).

Andre

PS: after this 'short course' I will be able to integrate VLC for video/audio streaming patching of the firmware (linux source code available) :D :) :D :) :D :) :cool:

LESS COOL: GOOGLE VI MAN -> Bloody hell, what an options.... I think CTRL-Z was my error. The file was probalby not saved in the directory. Hmmm... I think I have to spend a weekend on it. Or can somebody quicky say how to stop this vi editor and SAVE the file in the correct directory

Jean-Fabrice
30-03-2005, 20:58
Don't know if this is authorized... let me know

************************************************** **
okay, new year, new firmware, new howto

Since few days im using 1.9.2.7-2 from Oleg.
Like in changelogs promised there are some changes in iptables since 1.6.x.x.
These changes are effecting on my last howto about the wan webserver.
So lets start:

At first you need "webspace" f.e. a usb memory stick, or an usb harddisk. How to install this is explained in your asus manual. If there are problems with it, use the search function of this forum!
Optional you can use a service like "dyndns.org" to be aviable allways under the same hostname on internet. F.e. ernstl.dyndns.org. To update your ip on connect use the internal updating client. (see asus manual)

If not done yet, connect to your aus device with a telnet client of your choise, and login with username and password.
So far... After installing the usb memory device will be mounted as /tmp/harddisk on your asus device.
if /tmp/harddisk is mounted, you should see it while typing :


mount

If no, you have a problem and should investigate before continue

Now you should creat a seperated directory for your web files with this command:


mkdir /tmp/harddisk/web

assuming your external disk or usbpen is mounted on /tmp/harddisk (see 'mount' command)

If not alleady exist, create the post-boot and post-firewall scripts:


mkdir -p /usr/local/sbin && touch /usr/local/sbin/post-firewall
touch /usr/local/sbin/post-boot


Now open the vi editor by typing


vi /usr/local/sbin/post-boot

In vi press "i" to enter a simple insert mode. Type or paste in the following lines, to make busybox_httpd automaticly started, and mount usb device bevore:


mount /dev/discs/disc0/part1 /tmp/harddisk -t vfat
busybox_httpd -p 81 -h /tmp/harddisk/web


Press "ESC" to leave insert mode. Now type


:wq!

followed by "return" to write changes and quit vi.

Now open the post-firewall file with vi


vi /usr/local/sbin/post-firewall


Press "i" to enter insert mode and fill in the following line


iptables -D INPUT -j DROP
iptables -A INPUT -p tcp --dport 81 -j ACCEPT
iptables -A INPUT -p tcp --dport 80 -j ACCEPT
iptables -t nat -A PREROUTING -i ppp0 -p tcp --dport 80 -j DNAT --to-destination 192.168.1.1:81
iptables -A INPUT -j DROP

.. replacing '192.168.1.1' with the address of your wl500 and 'ppp0' with you WAN interface name.

Then "ESC" and


:wq!


Files should now be saved.
To vertify the the files are filled with our informations "cat" the files with the command "cat [filename]".

To store changes in flash enter the following commands in your shell:


flashfs enable
flashfs save
flashfs commit

Necesarry!!!


After reboot busybox_httpd should be started automaticaly on port 81, by the post-boot. Iptables makes it avaible on port 80 for wan site.
To access the webserver from lan site, you need to connect on port 80. F.e.:
http://192.168.1.1:81 (replace 192.168.1.1 with your wl500 IP address)

If you have problems do not hesitate to message me or post in Q&A forum!

************************************************** **

In case of problem with 'vi' editor, take a look on the Internet for short help on using vi.

Satleecher
30-03-2005, 21:07
Don't know if this is authorized... let me know

In case of problem with 'vi' editor, take a look on the Internet for short help on using vi.

Dear Jean

I have copied your additional instructions to local hard-disk. Your additional issues are essential to rookies. Thanks a lot. I hope your instructions will be kept on the forum. I will try it tomorrow, but like I have red it and compared it with unix command instructions on the web it should be dawn close to the works.

I will let you know tomorrow. You are tops to help out!!!

:) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :)

Satleecher
31-03-2005, 13:29
If you have problems do not hesitate to message me or post in Q&A forum!


Jean,

The instructions were complete and I believe ok (cat did show the files flash etc commands gave some logged responses). On the USB stick a folder web was made after reboot command. However, the webserver is not working yet. I think this has to do with the ' ppp0 ' I have no idea what should be filled in. 192.168.1.1 is the default ip and is maintained for me.I have put HTM pages in the web folder. Is the webserver really started or what do I need to fill in for ' ppp0' (in this case I have left ppp0 as it is).

Thanks again.
Andre

Jean-Fabrice
31-03-2005, 14:16
run 'ifconfig' and choose the interface name which support your Internet IP address.

Example for me :
eth1 Link encap:Ethernet HWaddr 00:0E:A6:C8:5C:88
inet addr:194.51.154.12 Bcast:194.51.154.255 Mask:255.255.255.0
inet6 addr: fe80::20e:a6ff:fec8:5c88/10 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:56341 errors:0 dropped:0 overruns:0 frame:0
TX packets:45541 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:42823699 (40.8 MiB) TX bytes:7906906 (7.5 MiB)
Interrupt:4 Base address:0x8000

My Internet IP Address is attached to eth1

Satleecher
31-03-2005, 20:15
run 'ifconfig' and choose the interface your Internet IP address. My IP Address is attached to eth1

Mine is also eth1, so I replace ppp0 with eth1 and :wq! + flashed and rebooted. I post the log. But ' After reboot busybox_httpd should be started automaticaly on port 81, by the post-boot. ' I can not see that post-boot and/or post-firewall are started. I have disabled virtual server port 80 to IIS-webserver and now I can access the asus-menus from WAN side as per 192.168.1.1!

Any hint or tips? :confused:

-> LOG

Jan 1 01:00:02 syslogd started: BusyBox v1.00 (2005.03.03-17:55+0000)
Jan 1 01:00:02 dnsmasq[52]: started, version 2.17 cachesize 150
Jan 1 01:00:02 dnsmasq[52]: DHCP, IP range 192.168.1.2 -- 192.168.1.254, lease time 24h
Jan 1 01:00:02 dnsmasq[52]: DHCP, /tmp/dnsmasq.log will be written every 28800s
Jan 1 01:00:02 dnsmasq[52]: read /etc/hosts - 4 addresses
Jan 1 01:00:02 dnsmasq[52]: reading /tmp/resolv.conf
Jan 1 01:00:02 kernel: Primary data cache 4kb, linesize 16 bytes (2 ways)
Jan 1 01:00:02 kernel: Linux version 2.4.20 (root@omnibook) (gcc version 3.2.3 with Broadcom modifications) #62 Mon Mar 14 21:39:22 MSK 2005
Jan 1 01:00:02 kernel: Setting the PFC value as 0x15
Jan 1 01:00:02 kernel: Determined physical RAM map:
Jan 1 01:00:02 kernel: memory: 01000000 @ 00000000 (usable)
Jan 1 01:00:02 kernel: On node 0 totalpages: 4096
Jan 1 01:00:02 kernel: zone(0): 4096 pages.
Jan 1 01:00:02 kernel: zone(1): 0 pages.
Jan 1 01:00:02 kernel: zone(2): 0 pages.
Jan 1 01:00:02 kernel: Kernel command line: root=/dev/mtdblock2 noinitrd init=/linuxrc console=ttyS0,115200
Jan 1 01:00:02 kernel: CPU: BCM4710 rev 0 at 125 MHz
Jan 1 01:00:02 kernel: !unable to setup serial console!
Jan 1 01:00:02 kernel: Calibrating delay loop... 82.94 BogoMIPS
Jan 1 01:00:02 kernel: Memory: 13920k/16384k available (1755k kernel code, 2464k reserved, 220k data, 68k init, 0k highmem)
Jan 1 01:00:02 kernel: Dentry cache hash table entries: 2048 (order: 2, 16384 bytes)
Jan 1 01:00:02 kernel: Inode cache hash table entries: 1024 (order: 1, 8192 bytes)
Jan 1 01:00:02 kernel: Mount-cache hash table entries: 512 (order: 0, 4096 bytes)
Jan 1 01:00:02 kernel: Buffer-cache hash table entries: 1024 (order: 0, 4096 bytes)
Jan 1 01:00:02 kernel: Page-cache hash table entries: 4096 (order: 2, 16384 bytes)
Jan 1 01:00:02 kernel: Checking for 'wait' instruction... unavailable.
Jan 1 01:00:02 kernel: POSIX conformance testing by UNIFIX
Jan 1 01:00:02 kernel: PCI: Fixing up bus 0
Jan 1 01:00:02 kernel: PCI: Fixing up bridge
Jan 1 01:00:02 kernel: PCI: Fixing up bus 1
Jan 1 01:00:02 kernel: Linux NET4.0 for Linux 2.4
Jan 1 01:00:02 kernel: Based upon Swansea University Computer Society NET3.039
Jan 1 01:00:02 kernel: Initializing RT netlink socket
Jan 1 01:00:02 kernel: Starting kswapd
Jan 1 01:00:02 kernel: Journalled Block Device driver loaded
Jan 1 01:00:02 kernel: devfs: v1.12c (20020818) Richard Gooch (rgooch@atnf.csiro.au)
Jan 1 01:00:02 kernel: devfs: boot_options: 0x1
Jan 1 01:00:02 kernel: NTFS driver v1.1.22 [Flags: R/O]
Jan 1 01:00:02 kernel: pty: 256 Unix98 ptys configured
Jan 1 01:00:02 kernel: Serial driver version 5.05c (2001-07-08) with MANY_PORTS SHARE_IRQ SERIAL_PCI enabled
Jan 1 01:00:02 kernel: loop: loaded (max 8 devices)
Jan 1 01:00:02 kernel: PPP generic driver version 2.4.2
Jan 1 01:00:02 kernel: PPP Deflate Compression module registered
Jan 1 01:00:02 kernel: PPP BSD Compression module registered
Jan 1 01:00:02 kernel: MPPE/MPPC encryption/compression module registered
Jan 1 01:00:02 kernel: Amd/Fujitsu Extended Query Table v1.1 at 0x0040
Jan 1 01:00:02 kernel: Physically mapped flash: Swapping erase regions for broken CFI table.
Jan 1 01:00:02 kernel: number of CFI chips: 1
Jan 1 01:00:02 kernel: Flash device: 0x400000 at 0x1fc00000
Jan 1 01:00:02 kernel: Physically mapped flash: squashfs filesystem found at block 936
Jan 1 01:00:02 kernel: Creating 5 MTD partitions on "Physically mapped flash":
Jan 1 01:00:03 kernel: 0x00000000-0x00040000 : "pmon"
Jan 1 01:00:03 kernel: 0x00040000-0x003e0000 : "linux"
Jan 1 01:00:03 kernel: 0x000ea190-0x003e0000 : "rootfs"
Jan 1 01:00:03 kernel: 0x003f0000-0x00400000 : "nvram"
Jan 1 01:00:03 kernel: 0x003e0000-0x003f0000 : "config"
Jan 1 01:00:03 kernel: sflash: chipcommon not found
Jan 1 01:00:03 kernel: NET4: Linux TCP/IP 1.0 for NET4.0
Jan 1 01:00:03 kernel: IP Protocols: ICMP, UDP, TCP
Jan 1 01:00:03 kernel: IP: routing cache hash table of 512 buckets, 4Kbytes
Jan 1 01:00:03 kernel: TCP: Hash tables configured (established 1024 bind 2048)
Jan 1 01:00:03 kernel: ip_conntrack version 2.1 (128 buckets, 1024 max) - 344 bytes per conntrack
Jan 1 01:00:03 kernel: ip_conntrack_pptp version 1.9 loaded
Jan 1 01:00:03 kernel: ip_nat_pptp version 1.5 loaded
Jan 1 01:00:03 kernel: ip_tables: (C) 2000-2002 Netfilter core team
Jan 1 01:00:03 kernel: ipt_time loading
Jan 1 01:00:03 kernel: NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.
Jan 1 01:00:03 kernel: IPv6 v0.8 for NET4.0
Jan 1 01:00:03 kernel: IPv6 over IPv4 tunneling driver
Jan 1 01:00:03 kernel: NET4: Ethernet Bridge 008 for NET4.0
Jan 1 01:00:03 kernel: 802.1Q VLAN Support v1.7 Ben Greear <greearb@candelatech.com>
Jan 1 01:00:03 kernel: All bugs added by David S. Miller <davem@redhat.com>
Jan 1 01:00:03 kernel: FAT: bogus logical sector size 21760
Jan 1 01:00:03 kernel: FAT: bogus logical sector size 21760
Jan 1 01:00:03 kernel: NTFS: Unable to set blocksize 512.
Jan 1 01:00:03 kernel: VFS: Mounted root (squashfs filesystem) readonly.
Jan 1 01:00:03 kernel: Mounted devfs on /dev
Jan 1 01:00:03 kernel: Freeing unused kernel memory: 68k freed
Jan 1 01:00:03 kernel: Warning: unable to open an initial console.
Jan 1 01:00:03 kernel: Algorithmics/MIPS FPU Emulator v1.5
Jan 1 01:00:03 kernel: eth0: Broadcom BCM47xx 10/100 Mbps Ethernet Controller 3.90.7.0
Jan 1 01:00:03 kernel: eth1: Broadcom BCM47xx 10/100 Mbps Ethernet Controller 3.90.7.0
Jan 1 01:00:03 kernel: PCI: Enabling device 01:02.0 (0004 -> 0006)
Jan 1 01:00:03 kernel: eth2: Broadcom BCM4320 802.11 Wireless Controller 3.90.7.0
Jan 1 01:00:03 kernel: device eth0 entered promiscuous mode
Jan 1 01:00:03 kernel: device eth2 entered promiscuous mode
Jan 1 01:00:03 kernel: br0: port 2(eth2) entering listening state
Jan 1 01:00:03 kernel: br0: port 1(eth0) entering listening state
Jan 1 01:00:03 kernel: br0: port 2(eth2) entering learning state
Jan 1 01:00:03 kernel: br0: port 1(eth0) entering learning state
Jan 1 01:00:03 kernel: br0: port 2(eth2) entering forwarding state
Jan 1 01:00:03 kernel: g
Jan 1 01:00:03 kernel: br0: port 1(eth0) entering forwarding state
Jan 1 01:00:03 kernel: br0: topology change detected, propagating
Jan 1 01:00:03 kernel: usb.c: registered new driver usbdevfs
Jan 1 01:00:03 kernel: usb.c: registered new driver hub
Jan 1 01:00:04 kernel: usb-ohci.c: USB OHCI at membase 0xb8004000, IRQ 2
Jan 1 01:00:04 kernel: usb-ohci.c: usb-00:04.0, PCI device 14e4:4715
Jan 1 01:00:04 kernel: usb.c: new USB bus registered, assigned bus number 1
Jan 1 01:00:04 kernel: hub.c: USB hub found
Jan 1 01:00:04 kernel: hub.c: 2 ports detected
Jan 1 01:00:05 kernel: hub.c: new USB device 00:04.0-1, assigned address 2
Jan 1 01:00:05 kernel: usb.c: USB device 2 (vend/prod 0x5dc/0xa300) is not claimed by any active driver.
Jan 1 01:00:05 kernel: lp0: using parport0 (polling).
Jan 1 01:00:06 kernel: usb.c: registered new driver usblp
Jan 1 01:00:06 kernel: printer.c: v0.13: USB Printer Device Class driver
Jan 1 01:00:07 kernel: usb.c: registered new driver audio
Jan 1 01:00:07 kernel: audio.c: v1.0.0:USB Audio Class driver
Jan 1 01:00:08 kernel: SCSI subsystem driver Revision: 1.00
Jan 1 01:00:08 kernel: Initializing USB Mass Storage driver...
Jan 1 01:00:08 kernel: usb.c: registered new driver usb-storage
Jan 1 01:00:08 kernel: scsi0 : SCSI emulation for USB Mass Storage devices
Jan 1 01:00:08 kernel: Vendor: Generic Model: STORAGE DEVICE Rev: 1.25
Jan 1 01:00:08 kernel: Type: Direct-Access ANSI SCSI revision: 02
Jan 1 01:00:08 kernel: Attached scsi removable disk sda at scsi0, channel 0, id 0, lun 0
Jan 1 01:00:09 kernel: SCSI device sda: 512000 512-byte hdwr sectors (262 MB)
Jan 1 01:00:09 kernel: sda: Write Protect is off
Jan 1 01:00:09 kernel: Partition check:
Jan 1 01:00:09 kernel: p1
Jan 1 01:00:09 kernel: USB Mass Storage support registered.
Jan 1 01:00:09 udhcpc[82]: udhcpc (v0.9.9-pre) started
Jan 1 01:00:09 kernel: lp driver: get device ID
Jan 1 01:00:10 dnsmasq[52]: read /etc/hosts - 4 addresses
Jan 1 01:00:10 dnsmasq[52]: reading /tmp/resolv.conf
Jan 1 01:00:10 dhcp client: deconfig: lease is lost
Jan 1 01:00:12 udhcpc[82]: Lease of 84.1xx.xx.xx obtained, lease time 5184000
Jan 1 01:00:12 udhcpc[82]: bogus packet, option fields too long.
30 times repeated
Jan 1 01:00:12 udhcpc[82]: bogus packet, option fields too long.
Jan 1 01:00:12 dnsmasq[52]: read /etc/hosts - 4 addresses
Jan 1 01:00:12 dnsmasq[52]: reading /tmp/resolv.conf
Jan 1 01:00:12 dnsmasq[52]: using nameserver 213.73.255.53#53
Jan 1 01:00:12 dnsmasq[52]: using nameserver 213.132.189.250#53
Jan 1 01:00:12 dnsmasq[52]: using nameserver 213.73.255.52#53
Jan 1 01:00:14 dhcp client: bound IP : 84.1xx.xx.xx from 84.1xx.xx.xx
Jan 1 01:00:20 kernel: VFS: Can't find ext3 filesystem on dev sd(8,1).
Jan 1 01:00:20 kernel: MSDOS FS: Using codepage 950
Jan 1 01:00:20 kernel: MSDOS FS: IO charset cp950
Jan 1 01:00:20 USB storage: vfat fs mounted to /tmp/harddisk
Mar 31 20:17:59 FTP server: daemon is started
Mar 31 20:18:09 ntp client: Synchronizing time with time.nist.gov ...


IP xxx have been put-in by myself.

Jean-Fabrice
31-03-2005, 20:30
There is nor messages neither popups or whatever saying you that post-firewall and post-boot are executed. You can only check that a least one processe they launch is running after booting.

If your busybox is running, you should see it (say 'busybox_httpd -p 81 -h /tmp/harddisk/web') in the process list when you type


ps -ef | grep busybox

and you should be able to access your web server (not asus one) using http://192.168.1.1:81/ or http://84.1xx.xx.xx/

no ?

Satleecher
31-03-2005, 20:47
no ?

[admin@(none) root]$ ps -ef | grep busybox

Response:

123 admin 348 S grep busybox


WL500g access: 192.168.1.1:80 and 84.xxx.xxx.xxx:80

So it seems something is still done wrongly by me. Since now WAN access is possible. Would you like to access it (via PM) :cool: ?

Must I enable NFS?

Jean-Fabrice
31-03-2005, 20:58
hummm. try


chmod +x /usr/local/sbin/post-firewall
chmod +x /usr/local/sbin/post-boot
flashfs save && flashfs commit
/usr/local/sbin/post-firewall
/usr/local/sbin/post-boot

and see again if busybox is running (ps-ef...)

If still in trouble, post the result of following commands :
ls -l /usr/local/sbin
mount
cat /usr/local/sbin/post-firewall
cat /usr/local/sbin/post-boot
ls -l /tmp/harddisk

Satleecher
31-03-2005, 21:35
[QUOTE=Jean-Fabrice]hummm. try


chmod +x /usr/local/sbin/post-firewall
chmod +x /usr/local/sbin/post-boot
flashfs save && flashfs enable
/usr/local/sbin/post-firewall
/usr/local/sbin/post-boot

and see again if busybox is running (ps-ef...)

This is the result:

[admin@(none) root]$ /usr/local/sbin/post-boot
mount: Mounting /dev/discs/disc0/part1 on /tmp/harddisk failed: Device or resource busy :confused:
busybox_httpd: bind: Address already in use

But then:

[admin@(none) root]$ ps -ef | grep busybox
151 admin 392 S busybox_httpd -p 81 -h /tmp/harddisk/web
174 admin 348 S grep busybox

But still

192.168.1.1:80 and 84.xxx.xxx.80 gets me into WL500g webserver
192.168.1.1:81 -> nothing

Jean-Fabrice
31-03-2005, 21:40
please post result of commands I ask you

Satleecher
31-03-2005, 21:45
please post result of commands I ask you

[admin@(none) root]$ chmod +x /usr/local/sbin/post-firewall
[admin@(none) root]$ chmod +x /usr/local/sbin/post-boot
[admin@(none) root]$ flashfs save && flashfs enable
tar: Removing leading '/' from member names
tmp/local/
tmp/local/sbin/
tmp/local/sbin/post-firewall
tmp/local/sbin/post-boot
tmp/local/root/
-rw-r--r-- 1 admin root 391 Mar 31 22:10 /tmp/flash.tar.gz
Check saved image and type "/sbin/flashfs commit" to commit changes
[admin@(none) root]$ /usr/local/sbin/post-firewall
[admin@(none) root]$ /usr/local/sbin/post-boot
mount: Mounting /dev/discs/disc0/part1 on /tmp/harddisk failed: Device or resource busy

ARE WE MISSING FLASHFS COMMIT ??

Jean-Fabrice
31-03-2005, 21:59
Well, I asked you for 5 commands :
ls -l /usr/local/sbin
mount
cat /usr/local/sbin/post-firewall
cat /usr/local/sbin/post-boot
ls -l /tmp/harddisk
but you didn't read what I ask for.

I have spent a lot of time with you now and I think that you have to read a bit this forum (like I did 6 month ago) to learn more on your unit and software it has in.
Then you can search google for iptables, busybox, vi, cat, ps and so on..
I'm sorry, I've done my best to help you but you absolutely need to forge you a basic knowledge of linux/asus/networking before continuing.

Satleecher
31-03-2005, 22:11
Well, I asked you for 5 commands :


Dear Jean,

You have been very patient with me. Thanks for your help. Here is the result of the commands. If you see something strange, please help me for the last time. I will get smarter and get a book titled ' unix for dummies ' :) This will help me. Again thank you for assisting...

[admin@(none) root]$ ls -l /usr/local/sbin
-rwxr-xr-x 1 admin root 93 Mar 31 13:40 post-boot
-rwxr-xr-x 1 admin root 241 Mar 31 20:16 post-firewall
[admin@(none) root]$ mount
/dev/root on / type squashfs (ro)
none on /dev type devfs (rw)
proc on /proc type proc (rw)
ramfs on /tmp type ramfs (rw)
usbfs on /proc/bus/usb type usbfs (rw)
/dev/discs/disc0/part1 on /tmp/harddisk type vfat (rw,sync)
[admin@(none) root]$ cat /usr/local/sbin/post-firewall
iptables -D INPUT -j DROP
iptables -A INPUT -p tcp --dport 81 -j ACCEPT
iptables -A INPUT -p tcp --dport 80 -j ACCEPT
iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 80 -j DNAT --to-destination
192.168.1.1:81
iptables -A INPUT -j DROP

[admin@(none) root]$ cat /usr/local/sbin/post-boot
mount /dev/discs/disc0/part1 /tmp/harddisk -t vfat
busybox_httpd -p 81 -h /tmp/harddisk/web

[admin@(none) root]$ ls -l /tmp/harddisk
drwxr-xr-x 2 admin root 4096 Mar 28 11:57 ftp_pub
drwxr-xr-x 2 admin root 4096 Jan 1 1980 ftp_pvt
drwxr-xr-x 4 admin root 4096 Mar 31 13:47 web
[admin@(none) root]$

Jean-Fabrice
31-03-2005, 22:44
don't see what's wrong but :
1) your post-boot and post-firewall should start with this line


#!/bin/sh

=> use vi to edit them

2) You should set a hostname to your unit using the asus web interface

flashfs save && flashfs commit, reboot and try again.
As far as I can see, your configuration is ok.

Satleecher
01-04-2005, 19:07
I am getting close thanks to your great help. When I manually enter

busybox_httpd -p 81 -h /tmp/harddisk/web

http://192.168.1.1:81/index.htm works !!! (that is one) at LAN side

http://84.xxx.xxx.xxx still calls on WL500G BUT.....

http://84.xxx.xxx.xxx:81/index.htm works!!! (that is two) at WAN side

So, I will analyse the line of the iptable once again and try to find out why port 80 and 81 on WAN side are not yet switched / WL500G access is disabled at port 80 on WAN side?

Great news!!!

The last post I had put at the end of the script i.s.o. beginning. Now it starts automatically, but still the port 80 and 81 switch is there. 'more' etc. demonstrates the file of iptables is ok. Hmmm....