OpenWrt Forum Archive

Topic: iptables / new Image

The content of this topic has been archived on 17 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I have what I believe to be the latest openwrt installed.. i ran ipkg update, ipkg upgrade so I should be up to date....

I setup custom iptables rules to allow routing of port 80 and 22  (http/ssh).
I ran iptables-save and it works fine.... 

problem is, everytime i reboot the router, all my iptables rules are flushed.

My other problem is.. i can seem to get tftp to work to transfer a new image to the router.  Is there anyway i can sftp the image? or are there particular instructions on doing this.  I tried using linksys' tftp client, aftp,

nothing seems to work.

Thanks for any help.

Sam

If you're going to use iptables-save make sure you have an iptables-restore somewhere in startup to load your saved rules. IMHO the save/restore is a waste of space, much more efficient to just put all your iptables rules in a script (like the one that comes with openwrt).

I'm confused as to why you want to reflash if you already have the latest firmware.

I wanted to flash the router to try out various different OS?  is that the proper term for the WRT54G(S).  I tried adding my custom rules to /etc/firewall.user but I was given an error that the file system is mounted as read-only:

-ash: cannot create /etc/firewall.user: Read-only file system

here's my fstab: 

root@OpenWrt:/etc# mount
/dev/root on /rom type squashfs (ro)
none on /rom/dev type devfs (rw)
/dev/mtdblock/4 on / type jffs2 (rw)
none on /proc type proc (rw)
none on /dev type devfs (rw)
none on /tmp type tmpfs (rw,nosuid,nodev)
none on /dev/pts type devpts (rw)

The discussion might have continued from here.