How to set ip address of usb0 in kernel source?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

How to set ip address of usb0 in kernel source?

跳至解决方案
2,952 次查看
sujay1
Contributor V

I'm using an imx6slevk board with yocto bsp and I've loaded the g_cdc module to use the usb port as serial port and as ethernet.

I'm using ifconfig usb0 192.168.44.30 netmask 255.255.255.0 to set the ip address of the usb port of the target

(as mentioned here: Using the USB port (as device) )

I'd like to do this automatically every time the  board boots instead of having to type it every time.

I followed this thread https://community.nxp.com/thread/459867  but setting in u-boot doesn't seem to have an effect on usb's ip address. what changes should I make in the source to do this?

标签 (3)
0 项奖励
回复
1 解答
2,858 次查看
b36401
NXP Employee
NXP Employee

You can add "ifconfig usb0 192.168.44.30 netmask 255.255.255.0" into startup script.

在原帖中查看解决方案

0 项奖励
回复
2 回复数
2,859 次查看
b36401
NXP Employee
NXP Employee

You can add "ifconfig usb0 192.168.44.30 netmask 255.255.255.0" into startup script.

0 项奖励
回复
2,858 次查看
sujay1
Contributor V

That worked for me

Just added a script in /etc/profile.d

Thanks for the info

0 项奖励
回复