I try to connect USB Huawei E8372 modem on my Ubuntu 18.04. dmesg command gives an information:
[ 371.616615] cdc_ether 1-6:1.0 eth0: register 'cdc_ether' at usb-0000:00:14.0-6, CDC Ethernet Device, 0c:5b:8f:27:9a:64
[ 371.616948] usb-storage 1-6:1.2: USB Mass Storage device detected
[ 371.617603] scsi host4: usb-storage 1-6:1.2
[ 371.625478] cdc_ether 1-6:1.0 enx0c5b8f279a64: renamed from eth0
[ 372.636698] scsi 4:0:0:0: Direct-Access HUAWEI TF CARD Storage 2.31 PQ: 0 ANSI: 2
[ 372.637021] sd 4:0:0:0: Attached scsi generic sg2 type 0
[ 372.637270] sd 4:0:0:0: Power-on or device reset occurred
[ 372.637965] sd 4:0:0:0: [sdc] Attached SCSI removable disk
[ 372.856712] usbcore: registered new interface driver usbserial_generic
[ 372.856727] usbserial: USB Serial support registered for generic
[ 372.860310] usbcore: registered new interface driver option
[ 372.860325] usbserial: USB Serial support registered for GSM modem (1-port)
So I have the enx0c5b8f279a64 interface. network-manager service adds this device (logs from service network-manager status
):
[1561201979.1919] devices added (path: /sys/devices/pci0000:00/0000:00:14.0/usb1/1-6/1-6:1.0/net/enx0c5b8f279a64, iface: enx0c5b8f279a64)
[1561201979.1919] device added (path: /sys/devices/pci0000:00/0000:00:14.0/usb1/1-6/1-6:1.0/net/enx0c5b8f279a64, iface: enx0c5b8f279a64)
But I can't access the Internet. Moreover, ifconfig doesn't show this interface.
I can use dhclient:
dhclient -v enx0c5b8f279a64
:
Listening on LPF/enx0c5b8f279a64/0c:5b:8f:27:9a:64
Sending on LPF/enx0c5b8f279a64/0c:5b:8f:27:9a:64
Sending on Socket/fallback
DHCPREQUEST of 192.168.8.100 on enx0c5b8f279a64 to 255.255.255.255 port 67 (xid=0x36f4d377)
DHCPNAK from 192.168.8.1 (xid=0x77d3f436)
DHCPDISCOVER on enx0c5b8f279a64 to 255.255.255.255 port 67 interval 3 (xid=0x5ad85374)
DHCPDISCOVER on enx0c5b8f279a64 to 255.255.255.255 port 67 interval 7 (xid=0x5ad85374)
DHCPREQUEST of 192.168.8.100 on enx0c5b8f279a64 to 255.255.255.255 port 67 (xid=0x7453d85a)
DHCPOFFER of 192.168.8.100 from 192.168.8.1
DHCPACK of 192.168.8.100 from 192.168.8.1
bound to 192.168.8.100 -- renewal in 41121 seconds.
After that, I will access the Internet, and network-manager logs:
[1561202049.0339] device (enx0c5b8f279a64): carrier: link connected
[1561202049.0415] device (enx0c5b8f279a64): carrier: link connected
I want that network-manager service set up the interface of the modem automatically without any manual steps like running dhclient. How to do it?
Thanks.
In ubuntu 18.04 netplan is used, just write for your interface enx0c5b8f279a64: "dhcp: true"" (see example here: https://netplan.io/examples)