Debian11.5设置静态IP 221021记录

183 阅读3分钟
设置Ip

在这里插入图片描述

对应影响的配置文件是 /etc/NetworkManager/system-connections/'Wired connection 1'

sudo cd /etc/NetworkManager/system-connections/
sudo nano /etc/NetworkManager/system-connections/'Wired connection 1'

内容为

[connection]
id=Wired connection 1
uuid=923cd012-af03-46f6-9774-cdfce75aea88
type=802-3-ethernet

[802-3-ethernet]
mac=00:0C:29:4D:5E:0D

[ipv4]
method=manual
dns=192.168.168.2;8.8.4.4;223.6.6.6;
addresses1=192.168.168.115;24;192.168.168.2;

[ipv6]
method=auto
ip6-privacy=2
设置DNS

设置DNS的文件是 /etc/resolv.conf

经测试,在图形界面设置DNS后, /etc/resolv.conf 的内容会相应改变 在这里插入图片描述

cat /etc/resolv.conf
sudo vi /etc/resolv.conf

可看到, /etc/resolv.conf 的内容对应图形界面的DNS

# Generated by NetworkManager
nameserver 192.168.168.2
nameserver 114.114.114.114
nameserver 8.8.8.8

所以在命令行界面可以用修改该文件的方式修改DNS

packages popcon size type description
network-manager V:369, I:434 14941 config::NM NetworkManager (daemon): manage the network automatically
network-manager-gnome V:127, I:365 5428 config::NM NetworkManager (GNOME frontend)
ifupdown V:587, I:986 217 config::ifupdown standardized tool to bring up and down the network (Debian specific)
isc-dhcp-client V:219, I:982 2894 config::low-level DHCP client
pppoeconf V:0, I:7 192 config::helper configuration helper for PPPoE connection
wpasupplicant V:336, I:494 3910 , , client support for WPA and WPA2 (IEEE 802.11i)
wpagui V:0, I:2 801 , , Qt GUI client for wpa_supplicant
wireless-tools V:173, I:231 297 , , tools for manipulating Linux Wireless Extensions
iw V:202, I:467 294 , , tool for configuring Linux wireless devices
iproute2 V:701, I:952 3291 config::iproute2 iproute2, IPv6 and other advanced network configuration: ip(8), tc(8), etc
iptables V:308, I:925 2477 config::Netfilter administration tools for packet filtering and NAT (Netfilter)
iputils-ping V:205, I:997 118 test test network reachability of a remote host by hostname or IP address (iproute2)
iputils-arping V:5, I:71 60 test test network reachability of a remote host specified by the ARP address
iputils-tracepath V:4, I:44 52 test trace the network path to a remote host
ethtool V:97, I:272 635 test display or change Ethernet device settings
mtr-tiny V:6, I:53 161 test::low-level trace the network path to a remote host (curses)
mtr V:4, I:44 214 , , trace the network path to a remote host (curses and GTK)
gnome-nettool V:1, I:29 2492 , , tools for common network information operations (GNOME)
nmap V:27, I:231 4453 , , network mapper / port scanner (Nmap, console)
zenmap V:0, I:3 2939 , , network mapper / port scanner (GTK)
tcpdump V:18, I:197 1336 , , network traffic analyzer (Tcpdump, console)
wireshark I:51 61 , , network traffic analyzer (Wireshark, GTK)
tshark V:2, I:30 416 , , network traffic analyzer (console)
tcptrace V:0, I:2 401 , , produce a summarization of the connections from tcpdump output
snort V:0, I:1 2203 , , flexible network intrusion detection system (Snort)
ntopng V:1, I:1 15904 , , display network usage in web browser
dnsutils V:35, I:408 278 , , network clients provided with BIND: nslookup(8), nsupdate(8), dig(8)
dlint V:0, I:5 53 , , check DNS zone information using nameserver lookups
dnstracer V:0, I:1 60 , , trace a chain of DNS servers to the source

Debain各版本 bd cd dvd iso 归档下载地址 --- Debian CDs/DVDs archive --- http://cdimage.debian.org/cdimage/archive/

阿里巴巴开源镜像站 阿里巴巴开源镜像站---Debian 镜像 阿里巴巴开源镜像站---Debian security镜像