我遇到了一个奇怪的问题:
这一切开始于我在 E-Bay 上买了一张非常便宜的无线网卡(1.30 美元)。
我花了三天时间才终于让驱动程序完成了一半的工作(一半的工作是因为它连接到互联网,但该设备被称为wlx00e62d021fe4
,而不是wlan0
或wlp13s0
)。
我安装了wpa_supplicant
,并连接到我的 WiFi 接入点,这是我的/etc/wpa_supplicant.conf
network={
ssid="Telstra8D49DA"
#psk="************"
psk=****************************************************************
}
(由于显而易见的原因,密码被清空:P)
这是我的/etc/network/interfaces
# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
# Generated by debian-installer.
# The loopback interface
auto lo
iface lo inet loopback
auto wlx00e62d021fe4
iface wlx00e62d021fe4 inet dhcp
我在中创建了一个服务/etc/systemd/system/dhcpcd.service
,内容如下
[Unit]
Description=Run dhclient wlx00e62d021fe4 at startup
[Install]
WantedBy=multi-user.target
[Service]
ExecStart=/sbin/dhclient wlx00e62d021fe4
ExecStop=
Type=oneshot
RemainAfterExit=yes
它在启动时使用以下命令运行:
# systemctl enable dhcpcd
但是,除非以太网线已插入,否则我的所有端口都不会打开。
以下是一些NMAP
输出:
无以太网:
Starting Nmap 7.60 ( https://nmap.org ) at 2017-12-10 14:46 AEDT
Nmap scan report for UbuntuServer (10.0.0.129)
Host is up (0.0076s latency).
All 1000 scanned ports on UbuntuServer (10.0.0.129) are closed
MAC Address: **:**:**:**:**:** (*******)
Nmap done: 1 IP address (1 host up) scanned in 0.52 seconds
使用以太网:
Starting Nmap 7.60 ( https://nmap.org ) at 2017-12-10 14:58 AEDT
Nmap scan report for UbuntuServer (10.0.0.129)
Host is up (0.0025s latency).
Not shown: 998 closed ports
PORT STATE SERVICE
22/tcp open ssh
80/tcp open http
MAC Address: **:**:**:**:**:** (*** *** ********* ****)
Nmap done: 1 IP address (1 host up) scanned in 0.34 seconds
拔下以太网后:
Starting Nmap 7.60 ( https://nmap.org ) at 2017-12-10 14:59 AEDT
Nmap scan report for UbuntuServer (10.0.0.129)
Host is up (0.0095s latency).
Not shown: 998 closed ports
PORT STATE SERVICE
22/tcp open ssh
80/tcp open http
MAC Address: **:**:**:**:**:** (*******)
Nmap done: 1 IP address (1 host up) scanned in 0.58 seconds
下面是输出uname -a
Linux UbuntuServer 4.13.0-19-generic #22-Ubuntu SMP Mon Dec 4 11:58:07 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
此外,所有软件包都已更新。我总是用这个命令进行更新
sudo apt update && sudo apt upgrade && sudo apt dist-upgrade && sudo apt autoremove --purge
当我输入时,服务器仍然可以连接到互联网,ping 8.8.8.8
并且可以“ping 通”(我的计算机用 ping 它ping 10.0.0.129
),而无需插入以太网线,所以它只是我的端口。
任何帮助将不胜感激!