在Ubuntu Stream 8(基于Ubuntu 22.04 LTS)中,网络配置可以通过多种方式进行,包括使用命令行和图形界面。以下是一个详细的网络设置指南:
/etc/netplan/
目录下的配置文件,例如 01-netcfg.yaml
或 50-cloud-init.yaml
。sudo nano /etc/netplan/01-netcfg.yaml
network:
version: 2
renderer: networkd
ethernets:
eth0:
dhcp4: no
addresses: [192.168.1.100/24]
gateway4: 192.168.1.1
nameservers:
addresses: [8.8.8.8, 8.8.4.4]
sudo netplan apply
ip addr show eth0
nmcli connection show
nmcli connection add type ethernet ifname eth0
辰迅云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>
推荐阅读: PHPStorm在Ubuntu上如何使用断点调试