AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-271974

Guerlando OCs's questions

Martin Hope
Guerlando OCs
Asked: 2019-10-14 05:47:09 +0800 CST

如何在debian中使用安装和使用网络管理器?

  • 0

我正在使用 Debian 9 运行 Qubes,因此我有一个非常重要的 debian 安装。我尝试安装network-manager,network-manager-gnome但我不知道如何启动它们。

我还安装了 gnome 设置面板。当我单击网络符号时,我收到此消息(经过长时间的延迟):

NetworkManager needs to be running

这是网络管理器服务:

● NetworkManager.service - Network Manager
   Loaded: loaded (/lib/systemd/system/NetworkManager.service; enabled; vendor preset: enabled)
  Drop-In: /lib/systemd/system/NetworkManager.service.d
           └─30_qubes.conf
   Active: inactive (dead)
Condition: start condition failed at Sun 2019-10-13 10:29:37 -03; 22min ago
           └─ ConditionPathExists=/var/run/qubes-service/network-manager was not met
     Docs: man:NetworkManager(8)
debian
  • 1 个回答
  • 1103 Views
Martin Hope
Guerlando OCs
Asked: 2018-10-07 06:06:31 +0800 CST

我的 USB 驱动器的 /etc/fstab 无法启动

  • 0

我曾经sudo blkid像这样使用 fstab 安装我的驱动器/etc/fstab:

UUID=1169dd89-29fe-436c-9aef-fa78ea7ee138 /media/hd ext4 defaults,auto,umask=000,users,rw 0 0

我也试过

PARTUUID=df63cda7-01  /media/hd ext4 defaults,auto,umask=000,users,rw 0 0

但是我的树莓派无法启动。在获取 uuid 之前,我还将系统格式化为 ext4。启动时进入紧急模式并要求我输入journalctl -xb

我现在添加了该nofail选项,因此它至少可以启动,所以我不必继续编辑我的 SD 卡:

PARTUUID=df63cda7-01  /media/hd ext4 defaults,auto,nofail,umask=000,users,rw 0 0

出了什么问题?

当我启动时,我看不到/dev/sda1,df -h但它出现在sudo blkid

pi@raspberrypi:~ $ sudo file -sL /dev/sda1
/dev/sda1: Linux rev 1.0 ext4 filesystem data, UUID=1169dd89-29fe-436c-9aef-fa78ea7ee138 (extents) (64bit) (large files) (huge files)

这是我重新连接驱动器时的 dmesg-w

[ 1156.384704] usb 1-1.2: USB disconnect, device number 5
[ 1156.399483] sd 0:0:0:0: [sda] Synchronizing SCSI cache
[ 1156.399843] sd 0:0:0:0: [sda] Synchronize Cache(10) failed: Result: hostbyte=0x01 driverbyte=0x00
[ 1165.388431] usb 1-1.2: new high-speed USB device number 6 using dwc_otg
[ 1165.600753] usb 1-1.2: New USB device found, idVendor=0bc2, idProduct=231a
[ 1165.600776] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1165.600787] usb 1-1.2: Product: Expansion
[ 1165.600796] usb 1-1.2: Manufacturer: Seagate
[ 1165.600806] usb 1-1.2: SerialNumber: NA8Z9LSP
[ 1165.606573] usb-storage 1-1.2:1.0: USB Mass Storage device detected
[ 1165.629063] scsi host0: usb-storage 1-1.2:1.0
[ 1166.650056] scsi 0:0:0:0: Direct-Access     Seagate  Expansion        0708 PQ: 0 ANSI: 6
[ 1166.657494] sd 0:0:0:0: Attached scsi generic sg0 type 0
[ 1167.877041] sd 0:0:0:0: [sda] 1953525167 512-byte logical blocks: (1.00 TB/932 GiB)
[ 1167.877944] sd 0:0:0:0: [sda] Write Protect is off
[ 1167.877969] sd 0:0:0:0: [sda] Mode Sense: 47 00 00 08
[ 1167.889766] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[ 1167.936469]  sda: sda1
[ 1167.944243] sd 0:0:0:0: [sda] Attached SCSI disk
[ 1168.710434] EXT4-fs (sda1): Unrecognized mount option "umask=000" or missing value

这是我的lsusb:

pi@raspberrypi:~ $ lsusb
Bus 001 Device 004: ID 148f:7601 Ralink Technology, Corp. MT7601U Wireless Adapter
Bus 001 Device 006: ID 0bc2:231a Seagate RSS LLC 
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. SMC9514 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
boot raspberry-pi
  • 1 个回答
  • 795 Views
Martin Hope
Guerlando OCs
Asked: 2018-08-06 09:08:38 +0800 CST

Hostapd SSID 几秒钟后消失

  • 5

我正在使用 hostapd 通过我的树莓派零 w 内置 wifi 卡共享另一个 wifi 连接。树莓派启动后,我可以在手机中看到我的 SSID,甚至可以连接到它并使用它几秒钟。然后 SSID 就消失了。

hostapd 的状态显示没有问题:

pi@raspberrypi:~ $ sudo service hostapd status
● hostapd.service - LSB: Advanced IEEE 802.11 management daemon
   Loaded: loaded (/etc/init.d/hostapd; generated; vendor preset: enabled)
   Active: active (running) since Sun 2018-08-05 16:55:06 UTC; 6min ago
     Docs: man:systemd-sysv-generator(8)
  Process: 557 ExecStart=/etc/init.d/hostapd start (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/hostapd.service
           └─597 /usr/sbin/hostapd -B -P /run/hostapd.pid /etc/hostapd/hostapd.conf

Aug 05 16:55:04 raspberrypi systemd[1]: Starting LSB: Advanced IEEE 802.11 management daemon...
Aug 05 16:55:06 raspberrypi hostapd[557]: Starting advanced IEEE 802.11 management: hostapd.
Aug 05 16:55:06 raspberrypi systemd[1]: Started LSB: Advanced IEEE 802.11 management daemon.

这是我的 dmesg:

[    9.951912] bcm2835_alsa bcm2835_alsa: card created with 8 channels
[   10.988983] brcmfmac: F1 signature read @0x18000000=0x1541a9a6
[   11.023394] brcmfmac: brcmf_fw_map_chip_to_name: using brcm/brcmfmac43430-sdio.bin for chip 0x00a9a6(43430) rev 0x000001
[   11.023812] usbcore: registered new interface driver brcmfmac
[   11.550743] brcmfmac: brcmf_c_preinit_dcmds: Firmware version = wl0: Oct 23 2017 03:55:53 version 7.45.98.38 (r674442 CY) FWID 01-e58d219f
[   11.551907] brcmfmac: brcmf_c_preinit_dcmds: CLM version = API: 12.2 Data: 7.11.15 Compiler: 1.24.2 ClmImport: 1.24.1 Creation: 2014-05-26 10:53:55 Inc Data: 9.10.39 Inc Compiler: 1.29.4 Inc ClmImport: 1.36.3 Creation: 2017-10-23 03:47:14 
[   12.469798] Indeed it is in host mode hprt0 = 00001101
[   14.180038] uart-pl011 20201000.serial: no DMA platform data
[   14.366758] usb 1-1: reset high-speed USB device number 2 using dwc_otg
[   14.366994] Indeed it is in host mode hprt0 = 00001101
[   16.080543] Adding 102396k swap on /var/swap.  Priority:-2 extents:1 across:102396k SSFS
[   16.161385] mt7601u 1-1:1.0: ASIC revision: 76010001 MAC revision: 76010500
[   16.252009] mt7601u 1-1:1.0: Warning: unsupported EEPROM version 0d
[   16.252028] mt7601u 1-1:1.0: EEPROM ver:0d fae:00
[   16.771510] ieee80211 phy1: Selected rate control algorithm 'minstrel_ht'
[   16.776815] usbcore: registered new interface driver mt7601u
[   18.456287] IPv6: ADDRCONF(NETDEV_UP): wlan1: link is not ready
[   18.625722] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[   18.625756] brcmfmac: power management disabled
[   18.753324] Bluetooth: Core ver 2.22
[   18.753500] NET: Registered protocol family 31
[   18.753508] Bluetooth: HCI device and connection manager initialized
[   18.753534] Bluetooth: HCI socket layer initialized
[   18.753548] Bluetooth: L2CAP socket layer initialized
[   18.753612] Bluetooth: SCO socket layer initialized
[   18.781182] Bluetooth: HCI UART driver ver 2.3
[   18.781197] Bluetooth: HCI UART protocol H4 registered
[   18.781202] Bluetooth: HCI UART protocol Three-wire (H5) registered
[   18.786141] Bluetooth: HCI UART protocol Broadcom registered
[   19.362969] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[   19.362997] Bluetooth: BNEP filters: protocol multicast
[   19.363027] Bluetooth: BNEP socket layer initialized
[   20.245972] wlan1: authenticate with 48:ee:0c:1f:d8:73
[   20.308671] wlan1: send auth to 48:ee:0c:1f:d8:73 (try 1/3)
[   20.310399] wlan1: authenticated
[   20.313517] wlan1: associate with 48:ee:0c:1f:d8:73 (try 1/3)
[   20.317906] wlan1: RX AssocResp from 48:ee:0c:1f:d8:73 (capab=0x411 status=0 aid=7)
[   20.362268] wlan1: associated
[   21.491599] IPv6: ADDRCONF(NETDEV_CHANGE): wlan1: link becomes ready
[   32.303384] nf_conntrack version 0.5.0 (7168 buckets, 28672 max)
[   33.692972] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready

wlan1是树莓派连接到的无线网络。wlan0是覆盆子自己内置的wifi。我没有看到任何错误。

这是/var/log/syslog:

Aug  5 16:55:06 raspberrypi kernel: [   33.692972] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
Aug  5 16:55:06 raspberrypi hostapd[557]: Starting advanced IEEE 802.11 management: hostapd.
Aug  5 16:55:06 raspberrypi dnsmasq[599]: started, version 2.76 cachesize 150
Aug  5 16:55:06 raspberrypi systemd[1]: Started LSB: Advanced IEEE 802.11 management daemon.
Aug  5 16:55:06 raspberrypi dnsmasq[599]: compile time options: IPv6 GNU-getopt DBus i18n IDN DHCP DHCPv6 no-Lua TFTP conntrack ipset auth DNSSEC loop-detect inotify
Aug  5 16:55:06 raspberrypi dnsmasq-dhcp[599]: DHCP, IP range 192.168.4.2 -- 192.168.4.20, lease time 1d
Aug  5 16:55:06 raspberrypi dnsmasq[599]: reading /run/dnsmasq/resolv.conf
Aug  5 16:55:06 raspberrypi dnsmasq[599]: using nameserver 192.168.25.1#53
Aug  5 16:55:06 raspberrypi dnsmasq[599]: read /etc/hosts - 5 addresses
Aug  5 16:55:06 raspberrypi dnsmasq[600]: Too few arguments.
Aug  5 16:55:06 raspberrypi systemd[1]: Started dnsmasq - A lightweight DHCP and caching DNS server.
Aug  5 16:55:06 raspberrypi systemd[1]: Reached target Multi-User System.
Aug  5 16:55:06 raspberrypi systemd[1]: Reached target Graphical Interface.
Aug  5 16:55:06 raspberrypi systemd[1]: Starting Update UTMP about System Runlevel Changes...
Aug  5 16:55:06 raspberrypi systemd[1]: Reached target Host and Network Name Lookups.
Aug  5 16:55:06 raspberrypi systemd[1]: Started Update UTMP about System Runlevel Changes.
Aug  5 16:55:06 raspberrypi systemd[1]: Startup finished in 1.995s (kernel) + 32.367s (userspace) = 34.362s.
Aug  5 16:55:07 raspberrypi avahi-daemon[188]: Joining mDNS multicast group on interface wlan0.IPv6 with address fe80::ba27:ebff:feaa:1f8.
Aug  5 16:55:07 raspberrypi avahi-daemon[188]: New relevant interface wlan0.IPv6 for mDNS.
Aug  5 16:55:07 raspberrypi avahi-daemon[188]: Registering new address record for fe80::ba27:ebff:feaa:1f8 on wlan0.*.
Aug  5 16:55:28 raspberrypi systemd[1]: Time has been changed
Aug  5 16:55:28 raspberrypi systemd[1]: apt-daily-upgrade.timer: Adding 27min 26.673226s random time.
Aug  5 16:55:28 raspberrypi systemd-timesyncd[173]: Synchronized to time server [2a01:4f8:110:30e1::9]:123 (2.debian.pool.ntp.org).
Aug  5 16:55:28 raspberrypi systemd[1]: apt-daily.timer: Adding 7h 36min 12.296585s random time.
Aug  5 17:01:05 raspberrypi systemd[1]: Created slice User Slice of pi.
Aug  5 17:01:05 raspberrypi systemd[1]: Started Session c1 of user pi.
Aug  5 17:01:05 raspberrypi systemd[1]: Starting User Manager for UID 1000...
Aug  5 17:01:06 raspberrypi systemd[668]: Listening on GnuPG cryptographic agent and passphrase cache.
Aug  5 17:01:06 raspberrypi systemd[668]: Listening on GnuPG cryptographic agent (access for web browsers).
Aug  5 17:01:06 raspberrypi systemd[668]: Listening on GnuPG cryptographic agent and passphrase cache (restricted).
Aug  5 17:01:06 raspberrypi systemd[668]: Reached target Timers.
Aug  5 17:01:06 raspberrypi systemd[668]: Reached target Paths.
Aug  5 17:01:06 raspberrypi systemd[668]: Listening on GnuPG cryptographic agent (ssh-agent emulation).
Aug  5 17:01:06 raspberrypi systemd[668]: Reached target Sockets.
Aug  5 17:01:06 raspberrypi systemd[668]: Reached target Basic System.
Aug  5 17:01:06 raspberrypi systemd[668]: Reached target Default.
Aug  5 17:01:06 raspberrypi systemd[668]: Startup finished in 178ms.
Aug  5 17:01:06 raspberrypi systemd[1]: Started User Manager for UID 1000.
Aug  5 17:02:40 raspberrypi wpa_supplicant[373]: wlan1: WPA: Group rekeying completed with 48:ee:0c:1f:d8:73 [GTK=CCMP]

我也没有看到任何错误

更新: 问题似乎只有在有人连接到网络后才会发生。syslog 上的最后一条消息是

Aug  5 17:39:27 raspberrypi hostapd: wlan0: STA 38:80:df:35:8a:d3 IEEE 802.11: associated
Aug  5 17:39:27 raspberrypi hostapd: wlan0: STA 38:80:df:35:8a:d3 RADIUS: starting accounting session 5B672BEA-00000000
Aug  5 17:39:27 raspberrypi hostapd: wlan0: STA 38:80:df:35:8a:d3 WPA: pairwise key handshake completed (RSN)
Aug  5 17:39:27 raspberrypi dnsmasq-dhcp[599]: DHCPDISCOVER(wlan0) 38:80:df:35:8a:d3
Aug  5 17:39:27 raspberrypi dnsmasq-dhcp[599]: DHCPOFFER(wlan0) 192.168.4.16 38:80:df:35:8a:d3
Aug  5 17:39:27 raspberrypi dnsmasq-dhcp[599]: DHCPREQUEST(wlan0) 192.168.4.16 38:80:df:35:8a:d3
Aug  5 17:39:27 raspberrypi dnsmasq-dhcp[599]: DHCPACK(wlan0) 192.168.4.16 38:80:df:35:8a:d3
Aug  5 17:41:35 raspberrypi hostapd: wlan0: STA 38:80:df:35:8a:d3 IEEE 802.11: disassociated
Aug  5 17:41:35 raspberrypi hostapd: wlan0: STA 38:80:df:35:8a:d3 IEEE 802.11: disassociated

但我没有看到任何错误。

更新:

这是我的/etc/hostapd/hostapd.conf文件:

interface=wlan0
driver=nl80211
ssid=NameOfNetwork
hw_mode=g
channel=7
wmm_enabled=0
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=AardvarkBadgerHedgehog
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP

更新:

这是更详细的hostapd:

Aug  5 18:21:22 raspberrypi systemd[1]: Started User Manager for UID 1000.
Aug  5 18:21:40 raspberrypi hostapd: wlan0: STA 38:80:df:35:8a:d3 IEEE 802.11: associated
Aug  5 18:21:40 raspberrypi hostapd: wlan0: STA 38:80:df:35:8a:d3 WPA: event 1 notification
Aug  5 18:21:40 raspberrypi hostapd: wlan0: STA 38:80:df:35:8a:d3 WPA: start authentication
Aug  5 18:21:40 raspberrypi hostapd: wlan0: STA 38:80:df:35:8a:d3 IEEE 802.1X: unauthorizing port
Aug  5 18:21:40 raspberrypi hostapd: wlan0: STA 38:80:df:35:8a:d3 WPA: sending 1/4 msg of 4-Way Handshake
Aug  5 18:21:40 raspberrypi hostapd: wlan0: STA 38:80:df:35:8a:d3 WPA: EAPOL-Key timeout
Aug  5 18:21:40 raspberrypi hostapd: wlan0: STA 38:80:df:35:8a:d3 WPA: sending 1/4 msg of 4-Way Handshake
Aug  5 18:21:40 raspberrypi hostapd: wlan0: STA 38:80:df:35:8a:d3 WPA: received EAPOL-Key frame (2/4 Pairwise)
Aug  5 18:21:40 raspberrypi hostapd: wlan0: STA 38:80:df:35:8a:d3 WPA: sending 3/4 msg of 4-Way Handshake
Aug  5 18:21:40 raspberrypi hostapd: wlan0: STA 38:80:df:35:8a:d3 WPA: received EAPOL-Key frame (4/4 Pairwise)
Aug  5 18:21:40 raspberrypi hostapd: wlan0: STA 38:80:df:35:8a:d3 IEEE 802.1X: authorizing port
Aug  5 18:21:40 raspberrypi hostapd: wlan0: STA 38:80:df:35:8a:d3 RADIUS: starting accounting session 5B674006-00000000
Aug  5 18:21:40 raspberrypi hostapd: wlan0: STA 38:80:df:35:8a:d3 WPA: pairwise key handshake completed (RSN)
Aug  5 18:21:40 raspberrypi dnsmasq-dhcp[599]: DHCPDISCOVER(wlan0) 38:80:df:35:8a:d3
Aug  5 18:21:40 raspberrypi dnsmasq-dhcp[599]: DHCPOFFER(wlan0) 192.168.4.16 38:80:df:35:8a:d3
Aug  5 18:21:40 raspberrypi dnsmasq-dhcp[599]: DHCPREQUEST(wlan0) 192.168.4.16 38:80:df:35:8a:d3
Aug  5 18:21:40 raspberrypi dnsmasq-dhcp[599]: DHCPACK(wlan0) 192.168.4.16 38:80:df:35:8a:d3
Aug  5 18:21:54 raspberrypi systemd[664]: Time has been changed
Aug  5 18:21:54 raspberrypi systemd[1]: Time has been changed
Aug  5 18:21:54 raspberrypi systemd[1]: apt-daily.timer: Adding 10h 13min 39.087355s random time.
Aug  5 18:21:54 raspberrypi systemd[1]: apt-daily-upgrade.timer: Adding 28min 49.504522s random time.
Aug  5 18:22:27 raspberrypi systemd[1]: Time has been changed
Aug  5 18:22:27 raspberrypi systemd[1]: apt-daily.timer: Adding 55min 40.693498s random time.
Aug  5 18:22:27 raspberrypi systemd[1]: apt-daily-upgrade.timer: Adding 23min 53.062642s random time.
Aug  5 18:22:27 raspberrypi systemd[664]: Time has been changed
Aug  5 18:24:06 raspberrypi hostapd: wlan0: STA 38:80:df:35:8a:d3 IEEE 802.11: disassociated
Aug  5 18:24:06 raspberrypi hostapd: wlan0: STA 38:80:df:35:8a:d3 WPA: event 2 notification
Aug  5 18:24:06 raspberrypi hostapd: wlan0: STA 38:80:df:35:8a:d3 IEEE 802.1X: unauthorizing port
Aug  5 18:24:14 raspberrypi hostapd: wlan0: STA 38:80:df:35:8a:d3 IEEE 802.11: disassociated

更新:

我之前用 USB 以太网设置了这个树莓派。我现在重新安装了一个新的映像,并刚刚配置了无线 AP 功能所需的配置。问题仍然存在。之后它仍然会发生,sudo apt update && sudo apt upgrade -y因此它看起来更像是一个错误而不是错误的配置。

有人对如何调试它有任何想法吗?

networking wifi
  • 2 个回答
  • 5374 Views
Martin Hope
Guerlando OCs
Asked: 2018-08-05 20:44:20 +0800 CST

创建一个接入点以在两个无线连接之间“桥接”。/etc/network/interfaces 应该怎么看?

  • 1

我正在遵循本指南:将 Raspberry Pi 设置为独立网络 (NAT)中的接入点以创建接入点。唯一的区别是我正在使用以太网连接所在的另一个 wifi 连接,所以我只是在整个教程中进行了更改,因为eth0我的 USB 加密狗连接到我的路由器。wlan1wlan1

但是,没有关于该/etc/network/interfaces文件的任何内容。这是我的:

auto wlan0
allow-hotplug wlan0
iface wlan0 inet dhcp
#wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

auto wlan1
allow-hotplug wlan1
iface wlan1 inet dhcp
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

我可以看到 SSID 并连接到它,但它会一直获取 IP 地址。我认为这与/etc/network/interfaces. 看看我的ifconfig:

pi@raspberrypi:~ $ ifconfig 
lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 4  bytes 156 (156.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 4  bytes 156 (156.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.25.6  netmask 255.255.255.0  broadcast 192.168.25.255
        inet6 fe80::ba27:ebff:feaa:1f8  prefixlen 64  scopeid 0x20<link>
        ether b8:27:eb:aa:01:f8  txqueuelen 1000  (Ethernet)
        RX packets 42  bytes 5757 (5.6 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 37  bytes 5838 (5.7 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlan1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.25.6  netmask 255.255.255.0  broadcast 192.168.25.255
        inet6 2804:7f0:e181:b678:2e0:4dff:fe06:4f8  prefixlen 64  scopeid 0x0<global>
        inet6 fe80::2e0:4dff:fe06:4f8  prefixlen 64  scopeid 0x20<link>
        ether 00:e0:4d:06:04:f8  txqueuelen 1000  (Ethernet)
        RX packets 86  bytes 11978 (11.6 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 86  bytes 15855 (15.4 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

怎么wlan0会有IP 192.168.25.6?这是wlan1连接的路由器提供的 IP。

我应该如何编辑wlan0配置?我一直在尝试很多静态配置,但是当我做任何不同于屏幕上的操作时,板载 wifi 接口消失,然后 USB 加密狗取代了wlan0.

另外,有没有办法保证usb dongle总是能得到wlan1和板载wifi wlan0?似乎随意。

更新

● dhcpcd.service - dhcpcd on all interfaces
   Loaded: loaded (/lib/systemd/system/dhcpcd.service; enabled; vendor preset: enabled)
  Drop-In: /etc/systemd/system/dhcpcd.service.d
           └─wait.conf
   Active: failed (Result: exit-code) since Sun 2018-08-05 04:54:32 UTC; 7s ago
  Process: 853 ExecStart=/usr/lib/dhcpcd5/dhcpcd -q -w (code=exited, status=6)

Aug 05 04:54:32 raspberrypi systemd[1]: Starting dhcpcd on all interfaces...
Aug 05 04:54:32 raspberrypi dhcpcd[853]: Not running dhcpcd because /etc/network/interfaces
Aug 05 04:54:32 raspberrypi dhcpcd[853]: defines some interfaces that will use a
Aug 05 04:54:32 raspberrypi dhcpcd[853]: DHCP client or static address
Aug 05 04:54:32 raspberrypi systemd[1]: dhcpcd.service: Control process exited, code=exited status=6
Aug 05 04:54:32 raspberrypi systemd[1]: Failed to start dhcpcd on all interfaces.
Aug 05 04:54:32 raspberrypi systemd[1]: dhcpcd.service: Unit entered failed state.
Aug 05 04:54:32 raspberrypi systemd[1]: dhcpcd.service: Failed with result 'exit-code'.
networking wifi
  • 1 个回答
  • 358 Views
Martin Hope
Guerlando OCs
Asked: 2018-07-05 04:09:19 +0800 CST

如何使 wlan 始终成为默认路由?(ip 路由列表)

  • 9

每当我将 4G 调制解调器添加到我的 raspberry 时,它都会在默认路由 ou 之上ip route list,但是我希望一切都通过 wlan,并且只使用 4G 调制解调器来接收 SSH 连接。

我找到了有关如何禁用默认路由的答案。

但是,重新启动后,4G 调制解调器又回到顶部。

我如何使wlan0始终成为默认的第一条规则?

更新:

这是我连接 USB 加密狗时的 dmesg 输出:

[426102.910168] usb 1-1.5.1: new full-speed USB device number 6 using dwc_otg
[426103.046670] usb 1-1.5.1: not running at top speed; connect to a high speed hub
[426103.056674] usb 1-1.5.1: New USB device found, idVendor=12d1, idProduct=1f01
[426103.056693] usb 1-1.5.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[426103.056704] usb 1-1.5.1: Product: HUAWEI_MOBILE
[426103.056714] usb 1-1.5.1: Manufacturer: HUAWEI_MOBILE
[426103.056724] usb 1-1.5.1: SerialNumber: 0123456789ABCDEF
[426103.121355] usb-storage 1-1.5.1:1.0: USB Mass Storage device detected
[426103.122875] scsi host0: usb-storage 1-1.5.1:1.0
[426103.987177] usb 1-1.5.1: USB disconnect, device number 6
[426105.470211] usb 1-1.5.1: new full-speed USB device number 7 using dwc_otg
[426105.606666] usb 1-1.5.1: not running at top speed; connect to a high speed hub
[426105.615673] usb 1-1.5.1: New USB device found, idVendor=12d1, idProduct=14dc
[426105.615692] usb 1-1.5.1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[426105.615703] usb 1-1.5.1: Product: HUAWEI_MOBILE
[426105.615713] usb 1-1.5.1: Manufacturer: HUAWEI_MOBILE
[426105.766297] usb-storage 1-1.5.1:1.2: USB Mass Storage device detected
[426105.766768] scsi host0: usb-storage 1-1.5.1:1.2
[426105.855053] cdc_ether 1-1.5.1:1.0 eth1: register 'cdc_ether' at usb-3f980000.usb-1.5.1, CDC Ethernet Device, 0c:5b:8f:27:9a:64
[426105.855593] usbcore: registered new interface driver cdc_ether
[426106.785653] scsi 0:0:0:0: Direct-Access     HUAWEI   TF CARD Storage  2.31 PQ: 0 ANSI: 2
[426106.803758] sd 0:0:0:0: Attached scsi generic sg0 type 0
[426106.820687] sd 0:0:0:0: [sda] Attached SCSI removable disk

这里是ip addr

eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 0c:5b:8f:27:9a:64 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::584f:751f:bb3e:e26b/64 scope link 
       valid_lft forever preferred_lft forever

更新 2

我又附加了几次,直到它显示了eth1路线:

[10787.229141] usb 1-1.5: new full-speed USB device number 7 using dwc_otg
[10787.363515] usb 1-1.5: New USB device found, idVendor=05e3, idProduct=0606
[10787.363533] usb 1-1.5: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[10787.363544] usb 1-1.5: Product: USB Hub 2.0
[10787.363555] usb 1-1.5: Manufacturer: ALCOR
[10787.365166] hub 1-1.5:1.0: USB hub found
[10787.369831] hub 1-1.5:1.0: 4 ports detected
[10797.419094] usb 1-1.5.1: new full-speed USB device number 8 using dwc_otg
[10797.555636] usb 1-1.5.1: not running at top speed; connect to a high speed hub
[10797.565759] usb 1-1.5.1: New USB device found, idVendor=12d1, idProduct=1f01
[10797.565777] usb 1-1.5.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[10797.565789] usb 1-1.5.1: Product: HUAWEI_MOBILE
[10797.565799] usb 1-1.5.1: Manufacturer: HUAWEI_MOBILE
[10797.565808] usb 1-1.5.1: SerialNumber: 0123456789ABCDEF
[10797.630477] usb-storage 1-1.5.1:1.0: USB Mass Storage device detected
[10797.631101] scsi host0: usb-storage 1-1.5.1:1.0
[10798.472745] usb 1-1.5.1: USB disconnect, device number 8
[10799.469081] usb 1-1.5.1: new full-speed USB device number 9 using dwc_otg
[10799.630768] usb 1-1.5.1: not running at top speed; connect to a high speed hub
[10799.646891] usb 1-1.5.1: New USB device found, idVendor=12d1, idProduct=14dc
[10799.646909] usb 1-1.5.1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[10799.646920] usb 1-1.5.1: Product: HUAWEI_MOBILE
[10799.646930] usb 1-1.5.1: Manufacturer: HUAWEI_MOBILE
[10799.814489] usb-storage 1-1.5.1:1.2: USB Mass Storage device detected
[10799.815008] scsi host0: usb-storage 1-1.5.1:1.2
[10799.897788] cdc_ether 1-1.5.1:1.0 eth1: register 'cdc_ether' at usb-3f980000.usb-1.5.1, CDC Ethernet Device, 0c:5b:8f:27:9a:64
[10799.898127] usbcore: registered new interface driver cdc_ether
[10800.889652] scsi 0:0:0:0: Direct-Access     HUAWEI   TF CARD Storage  2.31 PQ: 0 ANSI: 2
[10800.910585] sd 0:0:0:0: Attached scsi generic sg0 type 0
[10800.923297] sd 0:0:0:0: [sda] Attached SCSI removable disk

这里是route -n

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.1.1     0.0.0.0         UG    0      0        0 wlan0
0.0.0.0         192.168.8.1     0.0.0.0         UG    207    0        0 eth1
0.0.0.0         192.168.1.1     0.0.0.0         UG    303    0        0 wlan0
169.254.0.0     0.0.0.0         255.255.0.0     U     202    0        0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U     204    0        0 docker0
169.254.0.0     0.0.0.0         255.255.0.0     U     206    0        0 veth4557ad2
172.17.0.0      0.0.0.0         255.255.0.0     U     0      0        0 docker0
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 wlan0
192.168.1.0     0.0.0.0         255.255.255.0   U     303    0        0 wlan0
192.168.8.0     0.0.0.0         255.255.255.0   U     207    0        0 eth1

看到我这样做ifmetric wlan0是为了能够将wlan0tossh用于我的覆盆子

更新 09/10:

allow-hotplug wlan0
iface wlan0 inet dhcp
    up ifmetric wlan0 0
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

这不会使我wlan0的指标为 0。我做错了什么?

networking debian
  • 4 个回答
  • 7383 Views
Martin Hope
Guerlando OCs
Asked: 2018-01-23 19:33:36 +0800 CST

如何通过以太网直接与 IP 摄像机通信(无交换机、集线器、路由器......)。相机和以太网端口中的不同子网

  • 0

我想配置一个位于我的树莓派以太网端口中的 IP 摄像机(我通过 wifi 连接到它)。

我连接了相机,这是我跑步时看到的ifconfig

eth0      Link encap:Ethernet  HWaddr b8:27:eb:a2:10:08  
          inet addr:169.254.248.2  Bcast:169.254.255.255  Mask:255.255.0.0
          inet6 addr: fe80::ce99:232c:964e:7070/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:5600 errors:0 dropped:0 overruns:0 frame:0
          TX packets:27715 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:3219770 (3.0 MiB)  TX bytes:10481558 (9.9 MiB)

所以这意味着我的树莓派有 IP 地址169.254.248.2。我尝试访问169.254.248.1和扫描,nmap 169.254.0.0/16但我看到的唯一主机是树莓派本身。

然后我在 eth0 上运行 tcpdump:

tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 262144 bytes
03:13:53.963493 IP (tos 0x0, ttl 64, id 13074, offset 0, flags [none], proto UDP (17), length 368)
    0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from b8:27:eb:a2:10:08 (oui Unknown), length 340, xid 0x252200b7, secs 65535, Flags [none]
          Client-Ethernet-Address b8:27:eb:a2:10:08 (oui Unknown)
          Vendor-rfc1048 Extensions
            Magic Cookie 0x63825363
            DHCP-Message Option 53, length 1: Discover
            Client-ID Option 61, length 7: ether b8:27:eb:a2:10:08
            SLP-NA Option 80, length 0""
            NOAUTO Option 116, length 1: Y
            MSZ Option 57, length 2: 1500
            Vendor-Class Option 60, length 44: "dhcpcd-6.7.1:Linux-4.9.48-v7+:armv7l:BCM2835"
            Hostname Option 12, length 11: "raspberrypi"
            T145 Option 145, length 1: 1
            Parameter-Request Option 55, length 14: 
              Subnet-Mask, Classless-Static-Route, Static-Route, Default-Gateway
              Domain-Name-Server, Hostname, Domain-Name, BR
              NTP, Lease-Time, Server-ID, RN
              RB, Option 119

看起来我的树莓派正试图为自己找到一个 IP。我没有从相机中听到任何声音。我不应该尝试获取 IP 的广播消息吗?

好的,所以我继续并使用以下配置文件安装了https://help.ubuntu.com/community/isc-dhcp-server :

# Sample /etc/dhcpd.conf
# (add your comments here)
default-lease-time 600;
max-lease-time 7200;
option subnet-mask 255.255.255.0;
option broadcast-address 169.254.248.255;
option routers 169.254.248.254;
option domain-name "mydomain.example";

subnet 169.254.248.0 netmask 255.255.255.0 {
range 169.254.248.10 169.254.248.100;
}

它应该让摄像机的 dhcp 客户端请求一个地址并获取169.254.248.10,对吗?

这些都不起作用,所以我开始记住关于这台相机的一些事情:

它们预先配置为在 192.168.1.x 上工作,并使用固定 IP(我不知道它是什么)。

这是否意味着相机永远不会在我的以太网端口上工作,除非我将以太网地址设置在 192.168.1.x 范围内?

我不应该从摄像机接收广播消息,即使我在不​​同的子网中并且即使它的 IP 是固定的?我想我应该收到 ARP 广播消息,通知它在哪个 IP 中,类似的,对吧?然而,当我这样做时,我没有听到任何来自相机的声音tcpdump -i eth0

192.168.1.x如果最后两个问题的答案是错误的,那么即使我的 wlan0 接口已经在该范围内工作,我是否可以让我的以太网端口在该范围内工作?(我的意思是,我至少可以以虚拟方式与相机交谈吗?因为它是原始以太网,我可以假装 eth0192.168.1.x只是为了欺骗相机)。我问这个是因为我所做的一切都是远程的,我不能弄乱 wlan 配置,也不能把它放到不同的子网中。

networking network-interface
  • 1 个回答
  • 2411 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    模块 i915 可能缺少固件 /lib/firmware/i915/*

    • 3 个回答
  • Marko Smith

    无法获取 jessie backports 存储库

    • 4 个回答
  • Marko Smith

    如何将 GPG 私钥和公钥导出到文件

    • 4 个回答
  • Marko Smith

    我们如何运行存储在变量中的命令?

    • 5 个回答
  • Marko Smith

    如何配置 systemd-resolved 和 systemd-networkd 以使用本地 DNS 服务器来解析本地域和远程 DNS 服务器来解析远程域?

    • 3 个回答
  • Marko Smith

    dist-upgrade 后 Kali Linux 中的 apt-get update 错误 [重复]

    • 2 个回答
  • Marko Smith

    如何从 systemctl 服务日志中查看最新的 x 行

    • 5 个回答
  • Marko Smith

    Nano - 跳转到文件末尾

    • 8 个回答
  • Marko Smith

    grub 错误:你需要先加载内核

    • 4 个回答
  • Marko Smith

    如何下载软件包而不是使用 apt-get 命令安装它?

    • 7 个回答
  • Martin Hope
    user12345 无法获取 jessie backports 存储库 2019-03-27 04:39:28 +0800 CST
  • Martin Hope
    Carl 为什么大多数 systemd 示例都包含 WantedBy=multi-user.target? 2019-03-15 11:49:25 +0800 CST
  • Martin Hope
    rocky 如何将 GPG 私钥和公钥导出到文件 2018-11-16 05:36:15 +0800 CST
  • Martin Hope
    Evan Carroll systemctl 状态显示:“状态:降级” 2018-06-03 18:48:17 +0800 CST
  • Martin Hope
    Tim 我们如何运行存储在变量中的命令? 2018-05-21 04:46:29 +0800 CST
  • Martin Hope
    Ankur S 为什么 /dev/null 是一个文件?为什么它的功能不作为一个简单的程序来实现? 2018-04-17 07:28:04 +0800 CST
  • Martin Hope
    user3191334 如何从 systemctl 服务日志中查看最新的 x 行 2018-02-07 00:14:16 +0800 CST
  • Martin Hope
    Marko Pacak Nano - 跳转到文件末尾 2018-02-01 01:53:03 +0800 CST
  • Martin Hope
    Kidburla 为什么真假这么大? 2018-01-26 12:14:47 +0800 CST
  • Martin Hope
    Christos Baziotis 在一个巨大的(70GB)、一行、文本文件中替换字符串 2017-12-30 06:58:33 +0800 CST

热门标签

linux bash debian shell-script text-processing ubuntu centos shell awk ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve