2

I have a USB device that works as a USB RNDIS ethernet device.

This device does not have DHCP capability so the host computer needs to allocate IP address for itself.

I tried to add to the /etc/network/interfaces

auto usb0
iface usb0 inet static
    address 192.168.7.15
    netmask 255.255.255.0
    network 192.168.7.0

Then I run into the problem similar to this one: when the device is not connected then usb0 will not show, and network-manager would fail at boot.

Is there a way to work around this?

3 Answers3

2

If you need to plug/unplug very frequently, a HWaddr should bind to the device like this 12:a5:cf:42:92:fd. For my case, I'm using g_ether.ko on an embeded linux system, run "insmod g_ether.ko host_addr=12:a5:cf:42:92:fd dev_addr=5e:bc:ca:27:92:b1". Then on the linux host (Ubuntu 12.04 LTS for my case), edit the file "/etc/NetworkManager/system-connections/Wired connection 2", and input something like

####################################
[802-3-ethernet]

duplex=full
mac-address=12:a5:cf:42:92:fd

[connection]

id=Wired connection 2
uuid=2862a666-c2e6-4a3a-8e0c-8705d93c92da
type=802-3-ethernet
timestamp=1501735507

[ipv6]

method=auto

[ipv4]

method=manual

addresses1=192.168.42.21;24;192.168.42.1;
###############################################

Last, save the file, and plug/replug the usb cable.

y. Liu
  • 86
0

Ok either you properly enable and run the NM or just purge/remove the NM and add an entry to /etc/network/interfaces like this:

        auto usb0
        iface usb0 inet dhcp

then restart the box or just the networking service

I hope it will get the ip. try it.

And make sure that the drivers for that USB device are installed

0

You can change the settings for that specific connection by choosing Edit Connections in the drop-down menu for the Network Manager icon in the panel. In this dialog, select the wired connection in question, choose to edit it, go to the IPv4 tab, and change to Manual connection. There are also other link-local and such type connections you can use if necessary.

dobey
  • 41,650