Is there a tool to generate a config.xml file?

Utilities and tools for networking, routers, setup etc
Post Reply
mrfree2ita
Novice
Novice
Posts: 25
Joined: Fri Nov 05, 2010 12:33 pm

Is there a tool to generate a config.xml file?

Post by mrfree2ita » Fri Nov 12, 2010 1:37 pm

I need to separate wlan and eth interfaces, instead of using br0, and tell the router to nat all wlan clients on eth... unfortunately my wireless interface isn't supported by routertech firmware yet so I need to use the latest original firmware for a D-Link G624T (Hw A5, 32MB)

I think it's technically possible to *manually* implement this configuration with the original firmware... I thought about config.xml file

So I'd like to use a tool to generate a config.xml file for this kind of lan grouping
or otherwise I hope to find someone that gently send me a config.xml generated from a running RT firmware installation
or I'll must flash RT -> generate config.xml -> flash the original firmaware (I'd like to avoid this solution :))
mstombs
RouterTech Team
RouterTech Team
Posts: 3753
Joined: Wed Jan 10, 2007 11:54 pm

Re: Is there a tool to generate a config.xml file?

Post by mstombs » Fri Nov 12, 2010 3:13 pm

You can convert a binary config.bin to/from a text editable xml version using mcmcc's cfgconv utility http://mcmcc.bat.ru/acorp/utils/

Not sure this will help you achieve your aims, the 'core logic' that reads this config would have to support the functions you require and they would just be missing from the web gui?
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: Is there a tool to generate a config.xml file?

Post by thechief » Fri Nov 12, 2010 5:46 pm

mrfree2ita wrote:I need to separate wlan and eth interfaces, instead of using br0, and tell the router to nat all wlan clients on eth
Isn't this mainly an iptables issue? (i.e., you may be able to do this with iptables commands).
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.
mrfree2ita
Novice
Novice
Posts: 25
Joined: Fri Nov 05, 2010 12:33 pm

Re: Is there a tool to generate a config.xml file?

Post by mrfree2ita » Sat Nov 13, 2010 3:52 pm

@mstombs
reading che config.xml file it uses lan group and bridge tag like RT firmware do (at lease apparently), so I think it has the logic to handle a little different network definition

@thechief
yup, I'll try to configure it manually via iptables and I think it should work... meanwhile I'm searching for a "clean" solution to implement this :)
If it isn't possible I think I can add some iptables magic to some init script or firewall specific boot script (start/stop for example)

I noticed the dlink firmware uses per default two bridge br0 and br1, the first uses all interfaces and the second is "empty". I think I could simply move wlan0 to br1 to achive my goal, but in this case I still need to tell router to nat br1 over br0.

Is there any config.xml file syntax definition (DTD or a simple list of possible tags)?
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: Is there a tool to generate a config.xml file?

Post by thechief » Sat Nov 13, 2010 4:52 pm

mrfree2ita wrote:Is there any config.xml file syntax definition (DTD or a simple list of possible tags)?
None that I know of. You will have to do it by trial and error. The iptables approach, if it works, would be a clean approach. All you would need do is to put it in a script and run the script each time you restart 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.
mrfree2ita
Novice
Novice
Posts: 25
Joined: Fri Nov 05, 2010 12:33 pm

Re: Is there a tool to generate a config.xml file?

Post by mrfree2ita » Sat Nov 13, 2010 5:32 pm

Ok... If I replace config with

Code: Select all

put my_config.xml "config.xml mtd3"
Do I will be able to reset to default config pushing the reset switch on the back? :)
mstombs
RouterTech Team
RouterTech Team
Posts: 3753
Joined: Wed Jan 10, 2007 11:54 pm

Re: Is there a tool to generate a config.xml file?

Post by mstombs » Sat Nov 13, 2010 6:02 pm

You need the bin format to load into flash - there's an example in the RouterTech firmware downloads. This isn't usually needed because there is a default config.xml in the readonly filesystem.

Reset button 'should' restore the default - BUT its a software reset and sometimes the software monitoring the reset switch dies, so you cannot rely on that.

You should be a able to use the bootloader pc-tool/ ftp interface again though.
mrfree2ita
Novice
Novice
Posts: 25
Joined: Fri Nov 05, 2010 12:33 pm

Re: Is there a tool to generate a config.xml file?

Post by mrfree2ita » Sun Nov 14, 2010 12:08 am

Where the router search for config when it starts? I mean if I change the /etc/config.xml file the router will read it?
mstombs
RouterTech Team
RouterTech Team
Posts: 3753
Joined: Wed Jan 10, 2007 11:54 pm

Re: Is there a tool to generate a config.xml file?

Post by mstombs » Sun Nov 14, 2010 12:23 am

The router reads the config from the flash mtd3 partition. This is a special 64kB block first 10K is for the env vars. You won't easily change /etc/config.xml - that will be embeddded in the readonly squashed filesystem. Many router GUIs have options to save /reload configuration?
mrfree2ita
Novice
Novice
Posts: 25
Joined: Fri Nov 05, 2010 12:33 pm

Re: Is there a tool to generate a config.xml file?

Post by mrfree2ita » Sun Nov 14, 2010 4:56 pm

mstombs the tool you have suggested works great, but if I try to simply remove eth0 from bridge br0 for example the ap doesn't come up... I'll try to read messages via serial console

Meanwhile which is the best way to add custom commands after boot?
I notice there is a single /etc/init.d/rcS script and a firewall-start script is there another way? I need to make my changes after all interface are up
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: Is there a tool to generate a config.xml file?

Post by thechief » Sun Nov 14, 2010 5:25 pm

mrfree2ita wrote:Meanwhile which is the best way to add custom commands after boot?
Check the telnet scripter here: viewtopic.php?f=19&t=282
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.
mrfree2ita
Novice
Novice
Posts: 25
Joined: Fri Nov 05, 2010 12:33 pm

Re: Is there a tool to generate a config.xml file?

Post by mrfree2ita » Sun Nov 14, 2010 5:35 pm

thechief wrote: Check the telnet scripter here: viewtopic.php?f=19&t=282
But I don't want to start a telnet session from my pc every time the router reboots... I need it runs some commands itself :)
mstombs
RouterTech Team
RouterTech Team
Posts: 3753
Joined: Wed Jan 10, 2007 11:54 pm

Re: Is there a tool to generate a config.xml file?

Post by mstombs » Sun Nov 14, 2010 6:10 pm

I wouldn't have thought there was any way to auto run custom commands in stock D-Link firmware. The scripts you refer to will be embedded in the readonly flash file system. There's an example here how a user who didn't want to mess with 3rd party firmware used "expect" under Linux to telnet in and reconfigure his D-Link router

http://www.csc.liv.ac.uk/~greg/projects/dlink.html
Post Reply