[OpenWrt-Devel] For RG100A-AA, How to modify the default value of /etc/config/network?

2015-07-01 Thread zhengfish
Hi, All

I'm using openwrt-14.07.

I want to modify the default value of /etc/config/network while I build the
images for RG100A-AA.
I tried to modify this file -- package/base-files/files/etc/config/network,
but it seems have no effect.
Which file should I modify?


Here is my network by default on RG100A-AA.

# cat /etc/config/network

config interface 'loopback'
option ifname 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'

config globals 'globals'
option ula_prefix 'fd4a:ad7a:34c0::/48'

config interface 'lan'
option ifname 'eth1'
option force_link '1'
option type 'bridge'
option proto 'static'
option ipaddr '192.168.1.1'
option netmask '255.255.255.0'
option ip6assign '60'

config interface 'wan'
option ifname 'eth0'
option proto 'dhcp'

config interface 'wan6'
option ifname '@wan'
option proto 'dhcpv6'

config switch
option name 'eth1'
option reset '1'
option enable_vlan '1'

config switch_vlan
option device 'eth1'
option vlan '1'
option ports '0 1 2 3 4 5'


-- 

 _ __ _ _
 ___| |__   ___ _ __   __ _   / _(_)___| |__
|_  / '_ \ / _ \ '_ \ / _` | | |_| / __| '_ \
 / /| | | |  __/ | | | (_| | |  _| \__ \ | | |
/___|_| |_|\___|_| |_|\__, | |_| |_|___/_| |_|
  |___/
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] For RG100A-AA, How to modify the default value of /etc/config/network?

2015-07-01 Thread N.Leiten
There's two ways of default configuration - first is statically for all 
platforms in package/base-files/files/etc/config/network and using 
'uci-default' hooks.
The second type is used for target depended configurations (either different 
ports on switch as lan/wan or even different interfaces for lan/wan, migration 
between different version of firmware, etc). The scripts itself are executed 
every time at bootup, but deleted when they return zero code. So they're never 
executed twice if all gone ok. They are located in etc/uci-defaults. Generally 
they are gotten from target/linux/platform/base-files/etc/uci-defaults 

In email dated Среда - 01 июля 2015 21:02:06 user zhengfish wrote:
 Hi, All
 
 I'm using openwrt-14.07.
 
 I want to modify the default value of /etc/config/network while I build the
 images for RG100A-AA.
 I tried to modify this file -- package/base-files/files/etc/config/network,
 but it seems have no effect.
 Which file should I modify?
 
 
 Here is my network by default on RG100A-AA.
 
 # cat /etc/config/network
 
 config interface 'loopback'
 option ifname 'lo'
 option proto 'static'
 option ipaddr '127.0.0.1'
 option netmask '255.0.0.0'
 
 config globals 'globals'
 option ula_prefix 'fd4a:ad7a:34c0::/48'
 
 config interface 'lan'
 option ifname 'eth1'
 option force_link '1'
 option type 'bridge'
 option proto 'static'
 option ipaddr '192.168.1.1'
 option netmask '255.255.255.0'
 option ip6assign '60'
 
 config interface 'wan'
 option ifname 'eth0'
 option proto 'dhcp'
 
 config interface 'wan6'
 option ifname '@wan'
 option proto 'dhcpv6'
 
 config switch
 option name 'eth1'
 option reset '1'
 option enable_vlan '1'
 
 config switch_vlan
 option device 'eth1'
 option vlan '1'
 option ports '0 1 2 3 4 5'
 
 
 
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] For RG100A-AA, How to modify the default value of /etc/config/network?

2015-07-01 Thread Jannis Pinter
Hi zhengfish,

 I want to modify the default value of /etc/config/network while I build
 the images for RG100A-AA.
 I tried to modify this file --
 package/base-files/files/etc/config/network, but it seems have no effect.
 Which file should I modify?

to include custom files (e.g. config files) in your OpenWrt images,
create the directory files in your buildroot environment.

If you want to include a modified /etc/config/network in your builds,
create and adjust the following file:
buildroot dir/files/etc/config/network

There is some more information about this in the wiki [1].

[1] http://wiki.openwrt.org/doc/howto/build#custom_files

Regards,
Jannis




signature.asc
Description: OpenPGP digital signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel