How to set ip address of usb0 in kernel source?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to set ip address of usb0 in kernel source?

Jump to solution
1,595 Views
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?

Labels (3)
0 Kudos
1 Solution
1,501 Views
b36401
NXP Employee
NXP Employee

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

View solution in original post

0 Kudos
2 Replies
1,502 Views
b36401
NXP Employee
NXP Employee

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

0 Kudos
1,501 Views
sujay1
Contributor V

That worked for me

Just added a script in /etc/profile.d

Thanks for the info

0 Kudos