
void MacSet(int port) { char* buf; int length;
if (sysNvRamGet((UINT8 *)&npeMacAddr.macAddress, IX_IEEE803_MAC_ADDRESS_SIZE, nvRamNpeMacAddr[port]) == ERROR) { printf("ixe %d - Unable to read MAC address from non-volatile storage!\n" , port );
} /* Check for a valid MAC address - Only compare first three bytes */ npeMacAddr.macAddress[5] += port;
printf("ixe ETH PHY %d Hard Coded MAC address is: %2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x\n" , port ,npeMacAddr.macAddress[0], npeMacAddr.macAddress[1] ,npeMacAddr.macAddress[2], npeMacAddr.macAddress[3] ,npeMacAddr.macAddress[4], npeMacAddr.macAddress[5]);
printf ("npeMacAddr.macAddress0\n"); length = read (STD_IN, buf, sizeof(buf) - 1); npeMacAddr.macAddress[0]=atoi(buf); printf ("npeMacAddr.macAddress1\n"); length = read (STD_IN, buf, sizeof(buf) - 1); npeMacAddr.macAddress[1]=atoi(buf);
printf ("npeMacAddr.macAddress2\n"); length = read (STD_IN, buf, sizeof(buf) - 1); npeMacAddr.macAddress[2]=atoi(buf);
printf ("npeMacAddr.macAddress3\n"); length = read (STD_IN, buf, sizeof(buf) - 1); npeMacAddr.macAddress[3]=atoi(buf);
printf ("npeMacAddr.macAddress4\n"); length = read (STD_IN, buf, sizeof(buf) - 1); npeMacAddr.macAddress[4]=atoi(buf);
printf ("npeMacAddr.macAddress5\n"); length = read (STD_IN, buf, sizeof(buf) - 1); npeMacAddr.macAddress[5]=atoi(buf);
npeMacAddr.macAddress[5] += port;
printf("ixe ETH PHY %d Hard Coded MAC address is: %2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x\n" , port ,npeMacAddr.macAddress[0], npeMacAddr.macAddress[1] ,npeMacAddr.macAddress[2], npeMacAddr.macAddress[3] ,npeMacAddr.macAddress[4], npeMacAddr.macAddress[5]); }

通过ipmacset命令后,ip地址改了,MAC 也改了,可是这里去ping不通, 并且bootline中的目标板的地址却还是原来的,启动时显示的mac还是原来的,奇怪!!
-> ipmacset
ixe0 MAC address: 00:02:b3:3c:16:68 ixe1 MAC address: 00:02:b3:3c:16:69
ixe0 IP address: 169.254.113.143 ixe1 IP address: 169.254.113.144
Any Changes (y/n)> y
Change a MAC address (y/n)> y ixe0 MAC address: 00:02:b3:3c:16:68 00:02:b3:3c:16:68 ixe1 MAC address: 00:02:b3:3c:16:69 00:02:b3:3c:16:64
Change ixe IP address (y/n)> y ixe0 IP address: 169.254.113.143 169.254.113.146 ixe1 IP address: 169.254.113.144 169.254.113.147
ixe0 MAC address: 00:02:b3:3c:16:68 ixe1 MAC address: 00:02:b3:3c:16:64
ixe0 IP address: 169.254.113.146 ixe1 IP address: 169.254.113.147
Any Changes (y/n)> y
Change a MAC address (y/n)> n
Change ixe IP address (y/n)> n
ixe0 MAC address: 00:02:b3:3c:16:68 ixe1 MAC address: 00:02:b3:3c:16:64
ixe0 IP address: 169.254.113.146 ixe1 IP address: 169.254.113.147
Any Changes (y/n)> n
Writing interface data to non-volatile storage... New configuration written, changes will take effect after a reboot value = 0 = 0x0 -> reboot 系统重新启动后。。。
-> ipmacset
ixe0 MAC address: 00:02:b3:3c:16:68 ixe1 MAC address: 00:02:b3:3c:16:64
ixe0 IP address: 169.254.113.146 ixe1 IP address: 169.254.113.147
Any Changes (y/n)> n value = 0 = 0x0 ->
-> ping "169.254.113.146",1,0 ping: timeout no answer from 169.254.113.146 value = -1 = 0xffffffff -> ping "169.254.113.147",1,0 ping: timeout no answer from 169.254.113.147 value = -1 = 0xffffffff -> ip地址从这里看是改了,MAC 也改了,可是这里去ping不通, 并且bootline中的目标板的地址却还是原来的,奇怪!! '.' = clear field; '-' = go to previous field; ^D = quit
boot device : ixe1 processor number : 0 host name : host file name : vxworks inet on ethernet (e) : 169.254.113.144 inet on backplane (b): host inet (h) : 169.254.113.140 gateway inet (g) : user (u) : xjb ftp password (pw) (blank = use rsh): 1 flags (f) : 0x0 target name (tn) : startup script (s) : other (o) : ixe0 value = 0 = 0x0
回复
打赏帖 | |
---|---|
【Cortex-M】Systick Timer使用被打赏10分 | |
分享汽车防盗系统的组成与分类(一)被打赏5分 | |
VOFA+波形显示+JYD-31蓝牙发送和解析不定长数据被打赏10分 | |
【换取手持数字示波器】-STM32F4PWM控制LED灯管亮度被打赏22分 | |
【换取手持数字示波器】STM32F4驱动RPR-0521RS照度、接近一体型传感器被打赏23分 | |
宏定义和const关键字定义被打赏5分 | |
【分享开发笔记,赚取电动螺丝刀】几个单片机I2S外设的BLCK时钟对比被打赏20分 | |
【功率监测与控制系统DIY活动成果贴】DIY功率计与LabVIEW数据采集被打赏100分 | |
【分享开发笔记,赚取电动螺丝刀】使用ESP32S3调试I2S音频模块MAX98357被打赏22分 | |
【Freertos】任务管理被打赏10分 |