我插入了三个 USB 调制解调器 (W02-Lw43 JAZZ)。以下是一些信息:
_> ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 00:15:18:01:81:31 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.3/24 brd 192.168.1.255 scope global eth0
valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN group default qlen 1000
link/ether fc:de:56:ff:01:06 brd ff:ff:ff:ff:ff:ff
inet 192.168.10.100/24 brd 192.168.10.255 scope global dynamic noprefixroute eth1
valid_lft 60961sec preferred_lft 60961sec
4: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN group default qlen 1000
link/ether fc:de:56:ff:01:06 brd ff:ff:ff:ff:ff:ff
inet 192.168.11.100/24 brd 192.168.11.255 scope global dynamic noprefixroute eth2
valid_lft 60961sec preferred_lft 60961sec
5: eth3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN group default qlen 1000
link/ether fc:de:56:ff:01:06 brd ff:ff:ff:ff:ff:ff
inet 192.168.12.100/24 brd 192.168.12.255 scope global dynamic noprefixroute eth3
valid_lft 84051sec preferred_lft 84051sec
_> lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 008: ID 05c6:f00e Qualcomm, Inc.
Bus 001 Device 006: ID 05c6:f00e Qualcomm, Inc.
Bus 001 Device 005: ID 05c6:f00e Qualcomm, Inc.
Bus 001 Device 002: ID 2109:2813 VIA Labs, Inc.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
_> ls /dev/
autofs fd kvm memory_bandwidth ptmx ptypc sr1 tty17 tty3 tty42 tty55 ttyAML2 ttyp9 vcs2 vcsu2
block full lirc0 mmcblk1 pts ptypd stderr tty18 tty30 tty43 tty56 ttyS0 ttypa vcs3 vcsu3
bsg fuse log mmcblk1boot0 ptyp0 ptype stdin tty19 tty31 tty44 tty57 ttyS1 ttypb vcs4 vcsu4
btrfs-control gpiochip0 loop-control mmcblk1boot1 ptyp1 ptypf stdout tty2 tty32 tty45 tty58 ttyS2 ttypc vcs5 vcsu5
bus gpiochip1 loop0 mmcblk1p1 ptyp2 ram0 tty tty20 tty33 tty46 tty59 ttyS3 ttypd vcs6 vcsu6
cdrom hugepages loop1 mmcblk1p2 ptyp3 ram1 tty0 tty21 tty34 tty47 tty6 ttyp0 ttype vcsa vfio
cec0 hwrng loop2 mmcblk1rpmb ptyp4 ram2 tty1 tty22 tty35 tty48 tty60 ttyp1 ttypf vcsa1 vhci
cec1 i2c-0 loop3 mqueue ptyp5 ram3 tty10 tty23 tty36 tty49 tty61 ttyp2 uhid vcsa2 video0
char i2c-1 loop4 net ptyp6 random tty11 tty24 tty37 tty5 tty62 ttyp3 uinput vcsa3 watchdog
console i2c-2 loop5 network_latency ptyp7 rfkill tty12 tty25 tty38 tty50 tty63 ttyp4 uleds vcsa4 watchdog0
cpu_dma_latency iio:device0 loop6 network_throughput ptyp8 shm tty13 tty26 tty39 tty51 tty7 ttyp5 urandom vcsa5 zero
cuse initctl loop7 null ptyp9 snapshot tty14 tty27 tty4 tty52 tty8 ttyp6 v4l vcsa6 zram0
disk input mapper ppp ptypa snd tty15 tty28 tty40 tty53 tty9 ttyp7 vcs vcsu zram1
dri kmsg mem psaux ptypb sr0 tty16 tty29 tty41 tty54 ttyAML0 ttyp8 vcs1 vcsu1 zram2
我的问题是如何将 (Bus:Device) 上的 USB 映射到 ethX 和 /dev/XXX。例如:
USB Network interface Port
Bus 001 Device 008 eth0 /dev/ttyAML0
Bus 001 Device 006 eth1 /dev/ttyAML2
Bus 001 Device 005 eth2 /dev/???????
我对Linux了解不多。非常感谢。
答案1
如果需要的话就回答吧。我也遇到了同样的问题,并在此找到了答案邮政。
可以通过以下命令找到设备名称与编号之间的映射:
$ ls -la /sys/class/net
total 0
drwxr-xr-x 2 root root 0 Oct 29 12:49 .
drwxr-xr-x 56 root root 0 Oct 29 12:49 ..
lrwxrwxrwx 1 root root 0 Oct 29 12:49 eth0 -> ../../devices/pci0000:00/0000:00:19.0/net/eth0
lrwxrwxrwx 1 root root 0 Oct 29 12:49 lo -> ../../devices/virtual/net/lo