Ubuntu 未配置接口eth0
我正在尝试设置一个静态ip地址。以下是我的/etc/网络/接口:Ubuntu 未配置接口eth0,ubuntu,networking,router,static-ip-address,Ubuntu,Networking,Router,Static Ip Address,我正在尝试设置一个静态ip地址。以下是我的/etc/网络/接口: # interfaces(5) file used by ifup(8) and ifdown(8) auto lo iface lo inet loopback # primary network interfaces auto eth0 iface eth0 inet static address 192.168.1.88 netmask 255.255.255.0 netwo
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback
# primary network interfaces
auto eth0
iface eth0 inet static
address 192.168.1.88
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1
dns-nameservers 127.0.1.1
显然,我的机器根本没有eth0。我环顾四周,每个人都说要用eth0配置上述文件。是否有其他方法可以使用这些设备设置静态ip地址
$ ifconfig -a
eno1: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
ether 1c:1b:0d:0a:86:00 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 20 memory 0xdf400000-df420000
enp82s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.7 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::9b71:b459:c8d8:4bc5 prefixlen 64 scopeid 0x20<link>
ether 1c:1b:0d:0a:85:fe txqueuelen 1000 (Ethernet)
RX packets 3712 bytes 2691239 (2.6 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1501 bytes 157372 (157.3 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device memory 0xdf200000-df21ffff
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 1 (Local Loopback)
RX packets 25268 bytes 1537593 (1.5 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 25268 bytes 1537593 (1.5 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
wlp83s0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
ether e4:b3:18:8c:05:87 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
$ifconfig-a
eno1:标志=4099 mtu 1500
乙醚1c:1b:0d:0a:86:00 txqueuelen 1000(以太网)
接收数据包0字节0(0.0B)
接收错误0丢弃0超出0帧0
发送数据包0字节0(0.0B)
发送错误0丢弃0溢出0载波0冲突0
设备中断20存储器0xdf400000-df420000
enp82s0:标志=4163 mtu 1500
inet 192.168.1.7网络掩码255.255.255.0广播192.168.1.255
inet6 fe80::9b71:b459:c8d8:4bc5预桥64作用域ID 0x20
乙醚1c:1b:0d:0a:85:fe txqueuelen 1000(以太网)
接收数据包3712字节2691239(2.6MB)
接收错误0丢弃0超出0帧0
发送数据包1501字节157372(157.3KB)
发送错误0丢弃0溢出0载波0冲突0
设备内存0xdf200000-df21ffff
低:标志=73 mtu 65536
inet 127.0.0.1网络掩码255.0.0.0
inet6::1前缀轴128作用域ID 0x10
循环txqueuelen 1(本地环回)
接收数据包25268字节1537593(1.5 MB)
接收错误0丢弃0超出0帧0
发送数据包25268字节1537593(1.5 MB)
发送错误0丢弃0溢出0载波0冲突0
wlp83s0:标志=4099 mtu 1500
乙醚e4:b3:18:8c:05:87 txqueuelen 1000(以太网)
接收数据包0字节0(0.0B)
接收错误0丢弃0超出0帧0
发送数据包0字节0(0.0B)
发送错误0丢弃0溢出0载波0冲突0
是。只需用另一个接口替换eth0
例如:
auto eno1
iface eno1 inet static
address 192.168.1.88
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1
dns-nameservers 127.0.1.1
我可以用lo吗?根据netstat-i,lo的MTU更高。不,你不能
lo
是您的环回接口。确定。我选哪一个重要吗?我不知道这些接口之间的区别。只是尝试切换到eno1而不是关闭eth0。当我尝试sudo-ifdown-eno1时,我得到:ifdown:interface-eno1未配置。所有这些接口代表您机器上的单独物理网络接口。您是否正在尝试将enp82s0
的IP地址(当前IP地址为192.168.1.7
更改为192.168.1.88
?如果是,请选择enp82s0