编辑:
sudo ifdown wlx000e0008833e && sudo ifup -v wlx000e0008833e
:
Configuring interface wlx000e0008833e=wlx000e0008833e (inet)
/bin/run-parts --exit-on-error --verbose /etc/network/if-pre-up.d
run-parts: executing /etc/network/if-pre-up.d/ethtool
run-parts: executing /etc/network/if-pre-up.d/ifenslave
+ [ inet = meta ]
+ IF_BOND_SLAVES=
+ [ ]
+ [ ]
+ [ -z ]
+ exit
run-parts: executing /etc/network/if-pre-up.d/vlan
/bin/ip addr add 192.168.0.50/255.255.255.0 broadcast 192.168.0.255 dev wlx000e0008833e label wlx000e0008833e
/bin/ip link set dev wlx000e0008833e up
/bin/ip route add default via 192.168.0.1 dev wlx000e0008833e onlink
/bin/run-parts --exit-on-error --verbose /etc/network/if-up.d
run-parts: executing /etc/network/if-up.d/000resolvconf
run-parts: executing /etc/network/if-up.d/ethtool
run-parts: executing /etc/network/if-up.d/ifenslave
+ [ inet = meta ]
+ [ ]
run-parts: executing /etc/network/if-up.d/ip
run-parts: executing /etc/network/if-up.d/openssh-server
run-parts: executing /etc/network/if-up.d/upstart
dmesg | grep wlx
:
[ 16.181623] mt7601u 1-6:1.0 wlx000e0008833e: renamed from wlan0
[ 16.309273] IPv6: ADDRCONF(NETDEV_UP): wlx000e0008833e: link is not ready
[ 187.708914] IPv6: ADDRCONF(NETDEV_UP): wlx000e0008833e: link is not ready
[ 1333.308500] mt7601u 1-6:1.0 wlx000e0008833e: renamed from wlan0
[ 1333.502331] IPv6: ADDRCONF(NETDEV_UP): wlx000e0008833e: link is not ready
[ 1357.986859] IPv6: ADDRCONF(NETDEV_UP): wlx000e0008833e: link is not ready
情况:
我有一台装有 Ubuntu Server 16.04 操作系统的服务器。我需要使用 USB wifi 适配器将它连接到 wifi 网络,但是我在调整它时遇到了一些问题。
当我插入 USB wifi 适配器并运行时,ifconfig -a
我可以看到此信息(在我进行设置之前):
wlx000e0008833e Link encap:Ethernet HWaddr 00:0e:00:08:83:3e
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
无线配置:
network name (ssid):
开发者调制解调器password:
cHc0h6qZ3Hv8wscFsecurity:
WPA/WPA2IPv4 address:
192.168.0.109
当我连接到我的 PC ( ) 时,有关同一网络的信息Ubuntu Desktop 16.04 AMD64
:
关于我的调制解调器的信息:
我做的设置:
我将此脚本添加到/etc/networks/interfaces
:
# The wifi network interface
auto wlx000e0008833e
iface wlx000e0008833e inet static
address 192.168.0.109
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
dns-nameservers 192.168.0.1 8.8.8.8
wpa-ssid developer-modem
wpa-psk cHc0h6qZ3Hv8wscF
问题:
当我 ping 192.168.0.109
(我的调制解调器)时,我得到响应:
PING 192.168.0.109 (192.168.0.109) 56(84) bytes of data:
64 bytes from 192.168.0.109: icmp_seq=1 ttl=64 time=0.044 ms
64 bytes from 192.168.0.109: icmp_seq=2 ttl=64 time=0.047 ms
...
64 bytes from 192.168.0.109: icmp_seq=5 ttl=64 time=0.044 ms
--- 192.168.0.109 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 3997 ms
当我 ping 192.168.0.1
(1st dns-nameserver) 时,我收到错误响应:
PING 192.168.0.1 (192.168.0.1) 56(84) bytes of data:
From 192.168.0.109 icmp_seq=1 Destination Host Unreachable
From 192.168.0.109 icmp_seq=2 Destination Host Unreachable
...
From 192.168.0.109 icmp_seq=5 Destination Host Unreachable
--- 192.168.0.1 ping statistics ---
5 packets transmitted, 0 received, +3 errors, 100% packet loss, time 3017 ms
当我 ping 8.8.8.8
(2nd dns-nameserver) 时出现错误:
connect: Network is unreachable
当我 ping 任何其他地址(例如www.google.com
)时,我收到一个错误:
ping: unknown host www.google.com
问题:
我不确定一切都设置好了,因为我只是改变了/etc/network/interfaces
(见上面的改变),没有别的。
如何解决这个问题?
感谢帮助
我建议您将服务器上的接口文件更改为:
重启。
服务器连接了吗?查看: