openwrt_widora 路由模式更改网关地址不成功,此问题如何解决?



  • 网关配置问题,第一:在packet/base-file/file/etc/config/network 修改99 改成其他 比如88 编译烧录 网关仍然是192.168.1.1 未改变
    第二:packet/base-file/file/ect/network 拷贝一份到 openwrt-widora/file/etc下 并修改 192.168.88.1 ,烧录启动,网管修改正常,但是查看/etc/config/network 所有网口无法加入lan ,路由器wlan 也无法获取IP。


  • administrators

    修改源码地址:openwrt_widora/package/base-files/files/etc/preinit
    修改行:
    pi_ip=192.168.199.1
    pi_broadcast=192.168.199.255
    pi_netmask=255.255.255.0
    如下图:
    0_1496374075532_屏幕快照 2017-06-02 上午11.27.46.png



  • @mango您好 ,还是不行
    1_1496389830662_1.png
    0_1496389830662_2.png
    0_1496389883927_3.png


  • administrators

    正确修改再次,需要同时修改三个地方,解决了的话在这里给我反馈

    diff --git a/package/base-files/files/bin/config_generate b/package/base-files/files/bin/config_generate
    index 7bec566f3f..9da73e4b49 100755
    --- a/package/base-files/files/bin/config_generate
    +++ b/package/base-files/files/bin/config_generate
    @@ -53,7 +53,7 @@ EOF
            lan) uci -q batch <<EOF
     set network.$1.type='bridge'
     set network.$1.proto='static'
    -set network.$1.ipaddr='192.168.1.1'
    +set network.$1.ipaddr='192.168.8.1'
     set network.$1.netmask='255.255.255.0'
     set network.$1.ip6assign='60'
     EOF
    diff --git a/package/base-files/files/etc/config/network b/package/base-files/files/etc/config/network
    index 05bcdc5321..9d7b496455 100644
    --- a/package/base-files/files/etc/config/network
    +++ b/package/base-files/files/etc/config/network
    @@ -10,7 +10,7 @@ config interface lan
            option ifname   eth0
            option type     bridge
            option proto    static
    -       option ipaddr   192.168.99.1
    +       option ipaddr   192.168.8.1
            option netmask  255.255.255.0
            option ip6assign 60
     config interface wan
    diff --git a/package/base-files/files/etc/preinit b/package/base-files/files/etc/preinit
    index 31f861edf9..171a227e87 100755
    --- a/package/base-files/files/etc/preinit
    +++ b/package/base-files/files/etc/preinit
    @@ -7,8 +7,8 @@
     export PATH=/usr/sbin:/usr/bin:/sbin:/bin
    
     pi_ifname=
    -pi_ip=192.168.1.1
    -pi_broadcast=192.168.1.255
    +pi_ip=192.168.8.1
    +pi_broadcast=192.168.8.255
     pi_netmask=255.255.255.0
    
     fs_failsafe_ifname=
    


  • @mango 您好,目前按照您的步骤修改,网关修改成功了



  • @mango 如果我想增加一个接口,我在改动了如下
    diff --git a/package/base-files/files/etc/config/network b/package/base-files/files/etc/config/network
    index 05bcdc5..9c69c36 100644
    --- a/package/base-files/files/etc/config/network
    +++ b/package/base-files/files/etc/config/network
    @@ -10,7 +10,7 @@ config interface lan
    option ifname eth0
    option type bridge
    option proto static

    •   option ipaddr   192.168.99.1
      
    •   option ipaddr   192.168.1.252
        option netmask  255.255.255.0
        option ip6assign 60
      

    config interface wan
    @@ -18,3 +18,6 @@ config interface wan
    option proto dhcp
    config globals globals
    option ula_prefix auto
    +config interface '4G'

    •   option proto 'dhcp'
      
    •   option ifname 'wwan0' 
      

    但是没有作用


  • administrators

    @xinlan 没看出来是要做啥
    就像上边的步骤,改一个文件是不行的。



  • 我的意思是在固件中之间新建一个接口,最终实现widora的/etc/config/netcong 如下接口
    config interface '2G'
    option ifname 'wwan0'
    option _orig_ifname 'wwan0'
    option _orig_bridge 'false'
    option proto 'dhcp'


  • administrators

    @xinlan 你按照我的方法,在几个文件中通时修改
    如果改不成,就得考虑做成启动脚本了