deepin设置静态IP

/etc/network/interfaces里:

# https://unix.stackexchange.com/a/128662/453838
allow-hotplug enp0s2
iface enp0s2 inet static
	address 10.249.44.127
	netmask 255.255.248.0
	gateway 10.249.40.1
	dns-nameserver 10.248.98.30
# https://askubuntu.com/questions/616856/how-do-i-add-an-additional-ipv6-address-to-etc-network-interfaces
iface end1 inet6 static
        address fd00:1::1
        netmask 64

网卡名字和当前子网掩码可以通过ip addr看。

当前网关可以通过route -n查看。

当前dns服务器的IP在/etc/resolv.conf里。

重启网络:

sudo systemctl restart networking

参考文献:
Deepin设置静态IP
Linux查看DNS服务器及设置DNS服务器

posted @ 2024-09-28 13:42  寻找繁星  阅读(108)  评论(0编辑  收藏  举报