Navigation

    全志在线开发者论坛

    • Register
    • Login
    • Search
    • Categories
    • Tags
    • 在线文档
    • 社区主页

    tina linux IP地址每次重启都改变

    Linux
    5
    8
    444
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • jinxiangwzh
      jinxiangwzh LV 6 last edited by

      我按照网上的方法创建 /etc/sysconfig/network-scripts/ifcfg-eth0文件内,并写入如下内容

      BOOTPROTO=none
      DEFROUTE=yes
      DEVICE=eth0
      DNS3=8.8.8.8
      GATEWAY=172.17.123.1
      HWADDR=52:54:00:45:2c:cd
      IPADDR=172.17.123.130
      MTU=1452
      NETMASK=255.255.0.0
      NM_CONTROLLED=yes
      ONBOOT=yes
      STARTMODE=auto
      TYPE=Ethernet
      USERCTL=no
      
      

      重启后IP地址还是改变,请问应该怎么解决

      E 1 Reply Last reply Reply Quote Share 0
      • E
        efancier LV 5 @jinxiangwzh last edited by

        @jinxiangwzh ,网络接口管理用的是哪个工具?试试修改 /etc/newtork/ifaces 文件,里面添加 HWADDR=52:54:00:45:2c:cd

        jinxiangwzh 1 Reply Last reply Reply Quote Share 0
        • jinxiangwzh
          jinxiangwzh LV 6 @efancier last edited by

          @efancier 我看了一下,没有这个目录 ,要自己创建目录和文件吗?
          我没安装网络工具,配置的话是使用ifconfig

          /etc# ls
          TZ               crontabs         mtab             shadow
          asound.conf      device_info      openwrt_release  shells
          banner           e2fsck.conf      openwrt_version  ssh
          banner.failsafe  environment      opkg             sysconfig
          cedarx.conf      firmware         pam.conf         sysctl.conf
          config           fstab            pam.d            ts.conf
          cron.d           group            passwd           tslib-env.sh
          cron.daily       init.d           preinit          udev
          cron.hourly      inittab          profile          udhcpd.conf
          cron.minutely    mdev.conf        rc.common        wifi
          cron.monthly     modules-boot.d   rc.d
          cron.weekly      modules.d        security
          
          
          E 1 Reply Last reply Reply Quote Share 0
          • E
            efancier LV 5 @jinxiangwzh last edited by

            @jinxiangwzh , openWrt 使用的是这个文件: /etc/config/network

            1 Reply Last reply Reply Quote Share 0
            • RayZhang
              RayZhang LV 5 last edited by

              是不是路由器 DHCP Server 的 IP 分配策略问题?

              Y 1 Reply Last reply Reply Quote Share 0
              • Y
                YterAA LV 7 @RayZhang last edited by

                @rayzhang 机器没有烧mac,现在还是随机mac

                jinxiangwzh 1 Reply Last reply Reply Quote Share 0
                • jinxiangwzh
                  jinxiangwzh LV 6 @YterAA last edited by

                  @yteraa 😁 那mac是怎么烧的?

                  W 1 Reply Last reply Reply Quote Share 0
                  • W
                    whycan晕哥 LV 9 @jinxiangwzh last edited by

                    @jinxiangwzh

                    通过板上的其它唯一Id(flash,soc id)通过某些函数变换得到一个mac地址,然后通过这个命令设置:

                    ifconfig eth0 ether 00:01:02:03:04:05
                    
                    1 Reply Last reply Reply Quote Share 0
                    • 1 / 1
                    • First post
                      Last post

                    Copyright © 2022 深圳全志在线有限公司 粤ICP备2021084185号 粤公网安备44030502007680号

                    行为准则 | 用户协议 | 隐私权政策