IPTables && RouterTech Firmware

Support forum for routers of all shapes and sizes. As long as it's router based and doesn't fall into the other categories, this is the place to ask your questions.
Post Reply
RagingGrim
Novice
Novice
Posts: 15
Joined: Sat Mar 21, 2015 9:34 am

IPTables && RouterTech Firmware

Post by RagingGrim » Thu Apr 09, 2015 9:45 pm

Firmware version: RouterTech_3.7.1B_1350A_20120130_2.97 20120130232217
Router : Telkom duo plus 300WR

I was just curious how i could save the Iptables settings if i wanted to play around with it . I tried piping it to a file on the router but i should've known that would've failed.
I also tried doing a nc -p 968 -L -e bash or something similar however when using nc from my kali system i couldn't connect to that port and had to restart the router. I suppose i could keep trying using nc and pipes to get the current settings and make a backup of them.
Alternatively I could just backup the current router settings seeing as how i tinker with it a lot anyway XD
User avatar
thechief
RouterTech Team
RouterTech Team
Posts: 12067
Joined: Wed Feb 01, 2006 10:22 pm
Location: England, the Centre of Africa
Contact:

Re: IPTables && RouterTech Firmware

Post by thechief » Thu Apr 09, 2015 10:31 pm

You can create a minix partition (check the docs). There you can save stuff persistently. Otherwise, if you don't need the saved stuff to survive a reboot, then write it to the /var/ directory on the router.
The Chief: :afro: Be sure to read the Firmware FAQ and do a Forum Search before posting!
No support via PM. Ask all questions on the open forum.
RagingGrim
Novice
Novice
Posts: 15
Joined: Sat Mar 21, 2015 9:34 am

Re: IPTables && RouterTech Firmware

Post by RagingGrim » Fri Apr 10, 2015 8:46 am

Thanks for your reply! I'm working on that :D While i was busy I rebooted the router and refreshed the run command page in my browser ( after it had started ) but it's ip address was no longer 10.0.0.1 as I had set it but reverted back to 186.192.1.1 ; Currently I can connect to any port open on the router but the connection gets closed right after i connect.

Usually I'd fix this by just resetting the router to factory settings and reconfiguring but I'm getting pretty tired of that.
Our setup is simple , in the living room there's the main router (10.0.0.2) which supplies the internet connection to the repeater i have set up in my room (10.0.0.1). From there I either connect my pc and my sisters or just take the her lan cable all the way to the main router. The repeater is set as a dhcp relay so i can have good wifi strength in my room ( which is why I downloaded the custom firmware :P telkom's didn't work very well for me - so good work XD ).

Any suggestions ? ^^
User avatar
thechief
RouterTech Team
RouterTech Team
Posts: 12067
Joined: Wed Feb 01, 2006 10:22 pm
Location: England, the Centre of Africa
Contact:

Re: IPTables && RouterTech Firmware

Post by thechief » Fri Apr 10, 2015 1:51 pm

I have no idea about 186.192.1.1 - the RouterTech default is 192.168.1.1, so I don't know where that other IP address comes from (perhaps from your bootloader?). Clearly, something drastic happened when you rebooted (perhaps the environment got trashed and was replaced with default values?).

I suggest connecting to the RouterTech router directly via an ethernet cable, and then configure it to the 10.0.0.x IP range.
The Chief: :afro: Be sure to read the Firmware FAQ and do a Forum Search before posting!
No support via PM. Ask all questions on the open forum.
RagingGrim
Novice
Novice
Posts: 15
Joined: Sat Mar 21, 2015 9:34 am

Re: IPTables && RouterTech Firmware

Post by RagingGrim » Fri Apr 10, 2015 4:01 pm

My mistake the about that default Ip address!

My problem is that every time I reboot the router this happens ( just logged into my linux system after a storm and bam happened again ) , I have to say though I can configure the router so quickly after doing it 20 times ... XD

I have been just pulling the power plug after my computer is shut down so maybe that's a no-no....Fastest way would be to test this :D
Nope just tried it . Had to do everything again. The steps I followed :

1.) Turned Off the router properly whilst typing this.
2.) Did dhclient -r -v followed by a dhclient -v eth0 and got an ip address from 192.168.1.1 which shows that it reset to the default values again.
3.) Connected to that ip from my browser and disabled the dchp server but enabled the dchp relay to 10.0.0.2
4.) Repeated the commands in 2 and finished typing this message.

A temporary workaround would be to write a telnet script maybe ? Although I've never done that it shouldn't be too hard.
Am I doing something wrong?
RagingGrim
Novice
Novice
Posts: 15
Joined: Sat Mar 21, 2015 9:34 am

Re: IPTables && RouterTech Firmware

Post by RagingGrim » Fri Apr 10, 2015 4:24 pm

Fixed this!

I didn't see the button that clearly read SAVE ALL . I assumed that if I made a change to the system it would be considered as permanent. My bad - Thanks for all the help!
RagingGrim
Novice
Novice
Posts: 15
Joined: Sat Mar 21, 2015 9:34 am

Re: IPTables && RouterTech Firmware

Post by RagingGrim » Fri Apr 10, 2015 5:49 pm

I'd just like to add that I found an easy way to backup the iptables settings to my computer :P
not sure if i was unclear about that earlier.

what i did was :
1.) On my linux system ran nc -p 968 -L > Log.txt
2.) Opened up another terminal and used telnet to loginto 10.0.0.1
3.) From the telnet prompt ran iptables -L | nc 10.0.0.6 968
mstombs
RouterTech Team
RouterTech Team
Posts: 3753
Joined: Wed Jan 10, 2007 11:54 pm

Re: IPTables && RouterTech Firmware

Post by mstombs » Sun Apr 12, 2015 4:20 pm

Not sure what use such an iptables backup is, but you will also need the nat tables, I use

Code: Select all

iptables -nvL -t nat
for a verbose listing using ip addresses
RagingGrim
Novice
Novice
Posts: 15
Joined: Sat Mar 21, 2015 9:34 am

Re: IPTables && RouterTech Firmware

Post by RagingGrim » Sun Apr 12, 2015 4:26 pm

It's just a precaution , I've never worked with embedded firmware or firewalls .
Hell even linux is kind of new to me :P

but thanks!
Post Reply