<div dir="ltr"><div dir="ltr">Hello list,<div><br></div><div>Let me clarify my test environment:</div><div><table width="100%" cellspacing="10" style="margin:0px;padding:0px;color:rgb(0,0,0);font-family:"Microsoft Yahei","WenQuanYi Micro Hei",sans-serif,"Helvetica Neue",Helvetica,"Hiragino Sans GB";font-size:12.8px"><tbody style="margin:0px;padding:0px;box-sizing:border-box"><tr style="margin:0px;padding:0px;box-sizing:border-box"><td width="33%" style="padding:0px;box-sizing:border-box">Hostname</td><td style="padding:0px;box-sizing:border-box">LEDE</td></tr><tr style="margin:0px;padding:0px;box-sizing:border-box"><td width="33%" style="padding:0px;box-sizing:border-box">Model</td><td style="padding:0px;box-sizing:border-box">MediaTek MT7622 AC4300rfb1 board</td></tr><tr style="margin:0px;padding:0px;box-sizing:border-box"><td width="33%" style="padding:0px;box-sizing:border-box">Firmware Version</td><td style="padding:0px;box-sizing:border-box">LEDE Reboot 17.01-SNAPSHOT unknown / LuCI (svn-r75)</td></tr><tr style="margin:0px;padding:0px;box-sizing:border-box"><td width="33%" style="padding:0px;box-sizing:border-box">Kernel Version</td><td style="padding:0px;box-sizing:border-box">4.4.124</td></tr></tbody></table></div><div><br></div><div>Thank you</div><div>Jeonghum<br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">2020년 5월 19일 (화) 오후 3:30, Jeonghum Joh <<a href="mailto:oosaprogrammer@gmail.com">oosaprogrammer@gmail.com</a>>님이 작성:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr">Hello
Moritz Warning and people,<div><br></div><div>I found a script which looks like something that generate /etc/config/network. It is "99-default_network" under package/base-files/files/etc/board.d.</div><div><br></div><div>Let me post the content of it here :</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">#!/bin/sh<br>#<br># Copyright (C) 2013-2015 OpenWrt.org<br>#<br>. /lib/functions/uci-defaults.sh<br>board_config_update<br>json_is_a network object && exit 0<br>ucidef_set_interface_lan 'eth0'<br>[ -d /sys/class/net/eth1 ] && ucidef_set_interface_wan 'eth1'<br>board_config_flush<br>exit 0</blockquote><div><br></div><div><br></div><div>The content of /etc/config/network is shown below :</div><div><br></div><div>config interface 'lan'<br> option type 'bridge'<br> option ifname 'eth0'<br> option proto 'static'<br> option ipaddr '192.168.1.1'<br> option netmask '255.255.255.0'<br> option ip6assign '60'<br><br>config interface 'wan'<br> option ifname 'eth1'<br> option proto 'dhcp'<br><br>config interface 'wan6'<br> option ifname 'eth1'<br> option proto 'dhcpv6'<br></div><div><br></div><div>So I guessed above of 99-default_network generates
above of /etc/config/network
</div><div><br></div><div>I need to add something like below to /etc/config/network :</div><div><br></div><div>config interface 'wwan'<br> option ifname 'usb0'<br> option proto 'dhcp'<br><br></div><div>So I added something like below to
package/base-files/files/etc/board.d/99-default_network :</div><div><br></div><div> ucidef_set_interface_lan 'eth0'<br> [ -d /sys/class/net/eth1 ] && ucidef_set_interface_wan 'eth1'<br></div><div>+[ -d /sys/class/net/usb0 ] && ucidef_set_interface_wan 'usb0' <br></div><div><br></div><div>But this didn't resolve my problem.</div><div><br></div><div>I think I can just make some commands into startup script.</div><div>Isn't there more grace approach for me to automatically add usb0 interface into /etc/config/network?</div><div><br></div><div>Thank you in advance.</div><div>Jeonghum</div><div> <br></div><div><br></div><div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">2020년 5월 19일 (화) 오후 12:57, Jeonghum Joh <<a href="mailto:oosaprogrammer@gmail.com" target="_blank">oosaprogrammer@gmail.com</a>>님이 작성:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hello Moritz Warning<div><br></div><div>Thank you very much!</div><div>I can continue investigating by your hints.</div><div><br></div><div>Thank you.</div><div>Jeonghum</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">2020년 5월 19일 (화) 오전 11:37, Moritz Warning <<a href="mailto:moritzwarning@web.de" target="_blank">moritzwarning@web.de</a>>님이 작성:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 5/19/20 3:49 AM, Jeonghum Joh wrote:<br>
> I know how to do this for /etc/config/firewall.<br>
> It is package/network/config/firewall/files/firewall.config<br>
><br>
> But I cannot find /etc/config/network for default root file system.<br>
><br>
> Where can I find it?<br>
> How am I supposed to change settings in /etc/config/network of default root<br>
> file system of OpenWRT?<br>
><br>
> Thank you in advance!<br>
><br>
> Jeonghum<br>
><br>
><br>
> _______________________________________________<br>
> openwrt-devel mailing list<br>
> <a href="mailto:openwrt-devel@lists.openwrt.org" target="_blank">openwrt-devel@lists.openwrt.org</a><br>
> <a href="https://lists.openwrt.org/mailman/listinfo/openwrt-devel" rel="noreferrer" target="_blank">https://lists.openwrt.org/mailman/listinfo/openwrt-devel</a><br>
><br>
<br>
In your OpenWrt build root, create a file "files/etc/config/firewall".<br>
When you build OpenWrt, the file will be included in the image (and not overwritten).<br>
<br>
Btw., /etc/config/network is generated by a script on first boot and that is then deleted.<br>
But it is still accessible in /rom/etc/uci_defaults/02_network (not quite sure on the script name).<br>
<br>
- mwarning<br>
<br>
_______________________________________________<br>
openwrt-devel mailing list<br>
<a href="mailto:openwrt-devel@lists.openwrt.org" target="_blank">openwrt-devel@lists.openwrt.org</a><br>
<a href="https://lists.openwrt.org/mailman/listinfo/openwrt-devel" rel="noreferrer" target="_blank">https://lists.openwrt.org/mailman/listinfo/openwrt-devel</a><br>
</blockquote></div>
</blockquote></div></div>
</blockquote></div>