How to set ip address of usb0 in kernel source?

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

How to set ip address of usb0 in kernel source?

ソリューションへジャンプ
2,955件の閲覧回数
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,861件の閲覧回数
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,862件の閲覧回数
b36401
NXP Employee
NXP Employee

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

0 件の賞賛
返信
2,861件の閲覧回数
sujay1
Contributor V

That worked for me

Just added a script in /etc/profile.d

Thanks for the info

0 件の賞賛
返信