OUR NETWORK: TiVo Community TechLore Explore3DTV DVRplayground Dijit Community See all... About UsAdvertiseContact Us

 
Learn about scoring Forum's Raw Score: 306901.0
August 15, 2011 07:14 PM

Categories: OpenWRT

Rating (0 votes)
  • 1
  • 2
  • 3
  • 4
  • 5
Rate This!

Member Avatar

raju

Member
Joined: 08/15/2011

I am creating a custom build of OpenWRT and one of the things I'd like to do is automatically set some defaults configuration items.  The reason for this is that I'll be flashing a bunch of routers (several 100) and I don't want to have to configure each one individually.  In particular, I would like to:

1. Disable telnetd, enable sshd.

2. Set a root/admin password (not sure if setting this password will accomplish #1)

3. Enable wireless with a preset SSID, encryption and passwd.

I tried creating a /etc/config/wireless file in the firmware but it seems to get overwritten by /etc/init.d/network.

Any pointers on how to accomplish this?  In Tomato, there was a defaults.c file with the nvram code where I could pretty much do everything in one place, but I'm not what the equivilent is in OpenWrt.

Thanks

--raju 

Discussion:    Add a Comment | Comments 1-7 of 7 | Latest Comment

August 15, 2011 11:52 PM updated: August 15, 2011 11:55 PM

Though I am not much friendly with OpenWrt build system , I am trying to answer your quires ..

1. Do make menuconfig in packgae dir and do your own selection, save it, a .config file will be generated accordingly. Copy this .config file in another place. Use a script to copy this .config file to exact location when you want to build openwrt.

2. I guess to set the password you have to edit /etc/passwd file. You will find many good tutorials expalining how to do it. As per my knowledge concerns, in default case OpenWrt does not use any passwd for login.

3. As per my knowledge concern, in OpenWrt build system this wireless file is created during compilation, thats why your changes are being overwritten. You must find the exact location where it is created and do the changes accordingly.

August 16, 2011 11:17 AM updated: August 16, 2011 11:20 AM

 Hi Subhra, thanks for the response ...

I looked at /etc/password after I created the password there's what appears to be a crypt version of the password. thanks!  and yes, you are correct, there is no default password set.

So when i look in build_dir/target-*/root-*/etc/config/wireless the file I created is there, something else after compilation appears to overwrite it.  When I created a previous version of the firmware without the wireless file, it seemed to get autogenerated when i turned wifi on, so there's must be some other place where it get's it's configuration from.  Anyway, I have to do a bit more digging.

Thanks!

Subhra said: Though I am not much friendly with OpenWrt build system , I am trying to answer your quires .. 1. Do make menuconfig in packgae dir and do your own selection, save it, a .config file will be generated accordingly. Copy this .config file in another place. Use a script to copy this .config file to exact location when you want to build openwrt. 2. I guess to set the password you have to edit /etc/passwd file. You will find many good tutorials expalining how to do it. As per my knowledge concerns, in default case OpenWrt does not use any passwd for login.3. As per my knowledge concern, in OpenWrt build system this wireless file is created during compilation, thats why your changes are being overwritten. You must find the exact location where it is created and do the changes accordingly.
August 18, 2011 12:25 AM

Containts of build_dir/target-*/root-*/ are regenerated every time you compile Openwrt distribution. So, you have to make the changes somewhere else.
I m using backfire and was able to customise wireless configuration by making some changes in package/mac80211. You can look into in this directory to make your changes.

August 18, 2011 10:07 AM

Sorry, meant to followup, I did track down the script that generates the wireless config under mac80211, took a bit of `find`ing and `grep`ing :)

Thanks again

Subhra said: Containts of build_dir/target-*/root-*/ are regenerated every time you compile Openwrt distribution. So, you have to make the changes somewhere else. I m using backfire and was able to customise wireless configuration by making some changes in package/mac80211. You can look into in this directory to make your changes.

August 29, 2011 12:33 AM updated: August 29, 2011 12:34 AM

So, are able to make it working??
I found an inetrseting thing at my end. There is a script in package/mac80211/files/lib/wifi/mac80211.sh when the details of wifi-interface can be set. In openwrt the default settings is like that. you can do your changes here. Hope this will do your job.

config wifi-iface
option device wlan$devidx
option network lan
option mode ap
option ssid OpenWrt
option encryption none

Suppose you want to have the following configuratios.... SSID = OpenWRT-ap, encryption = wep and password = password, then your configuration will something like that ...

config 'wifi-iface'
option device wlan$devidx
option network lan
option mode ap
option ssid OpenWRT-ap
option encryption wep
option key password


Try this and please let us know the result.

August 29, 2011 11:50 AM

yes that exactly what I had done and it does work. I was just a bit surprised that there wasn't a central place where a bunch of defaults could be set, but as yet, I have not found any. In any case, I think this works perfectly for what I was trying to do.

Thanks!

August 29, 2011 11:57 PM

Its good to hear things are working properly at your end...

Discussion:    Add a Comment | Back to Top | Comments 1-7 of 7 | Latest Comment

Add Your Reply

(will not be displayed)

Email me when comments are added to this thread

 
 

Please log in or register to participate in this community!

Log In

Remember

Not a member? Sign up!

Did you forget your password?

You can also log in using OpenID.

close this window
close this window