휴대폰의 핫스팟에 연결할 때 systemd-resolved
DHCP에서 제공하는 DNS 목록을 사용하고 싶습니다. 어떤 이유에서인지 제 경우에는 그렇지 않은 것 같습니다.
우분투 22.04.1 LTS를 사용하고 있습니다
/etc/systemd/resolved.conf
비었다
모바일 WiFi에 연결하면 다음과 같은 결과가 나타납니다.
- IP 주소:
ip a show wlp3s0
3: wlp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000 link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff inet 192.168.138.69/24 brd 192.168.138.255 scope global dynamic noprefixroute wlp3s0 valid_lft 3411sec preferred_lft 3411sec
- 해당 시스템 로그 항목:
journalctl
paź 03 09:25:46 pc systemd-resolved[5434]: wlp3s0: Bus client set DNS server list to: 192.168.185.139, 192.168.22.175, 192.168.78.16
- 해당 TCP 트래픽
tcpdump -i wlp3s0 -e -nn -vv
tcpdump: listening on wlp3s0, link-type EN10MB (Ethernet), snapshot length 262144 bytes 09:25:46.427512 xx:xx:xx:xx:xx:xx > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 339: (tos 0xc0, ttl 64, id 0, offset 0, flags [DF], proto UDP (17), length 325) 0.0.0.0.68 > 255.255.255.255.67: [udp sum ok] BOOTP/DHCP, Request from xx:xx:xx:xx:xx:xx, length 297, xid 0xd83b70be, secs 1, Flags [none] (0x0000) Client-Ethernet-Address xx:xx:xx:xx:xx:xx Vendor-rfc1048 Extensions Magic Cookie 0x63825363 DHCP-Message (53), length 1: Request Client-ID (61), length 7: ether xx:xx:xx:xx:xx:xx Parameter-Request (55), length 17: Subnet-Mask (1), Time-Zone (2), Domain-Name-Server (6), Hostname (12) Domain-Name (15), MTU (26), BR (28), Classless-Static-Route (121) Default-Gateway (3), Static-Route (33), YD (40), YS (41) NTP (42), Unknown (119), Classless-Static-Route-Microsoft (249), Unknown (252) RP (17) MSZ (57), length 2: 576 Requested-IP (50), length 4: 192.168.138.69 Hostname (12), length 13: "pc" 09:25:46.445267 yy:yy:yy:yy:yy:yy > xx:xx:xx:xx:xx:xx, ethertype IPv4 (0x0800), length 366: (tos 0x0, ttl 64, id 44909, offset 0, flags [DF], proto UDP (17), length 352) 192.168.138.79.67 > 192.168.138.69.68: [udp sum ok] BOOTP/DHCP, Reply, length 324, xid 0xd83b70be, Flags [none] (0x0000) Your-IP 192.168.138.69 Server-IP 192.168.138.79 Client-Ethernet-Address xx:xx:xx:xx:xx:xx Vendor-rfc1048 Extensions Magic Cookie 0x63825363 DHCP-Message (53), length 1: ACK Server-ID (54), length 4: 192.168.138.79 Lease-Time (51), length 4: 3599 RN (58), length 4: 1799 RB (59), length 4: 3149 Subnet-Mask (1), length 4: 255.255.255.0 BR (28), length 4: 192.168.138.255 Default-Gateway (3), length 4: 192.168.138.79 Domain-Name-Server (6), length 4: 192.168.138.79 Hostname (12), length 13: "pc" Vendor-Option (43), length 15: 65.78.68.82.79.73.68.95.77.69.84.69.82.69.68
다음 명령을 실행하면 예상되는 DNS가 사용됩니다 dhclient -r wlp3s0 && dhclient wlp3s0
.
- 시스템 로그 항목:
journalctl
paź 03 09:45:02 pc systemd-resolved[5434]: wlp3s0: Bus client set DNS server list to: 192.168.138.79
- 전송하면
systemctl restart systemd-resolved
예기치 않은 IP가 다시 나타납니다.
systemd-resolved
IP 주소(,,)를 DHCP가 제공하는 주소 대신 DNS 서버로 사용하는 192.168.185.139
이유 192.168.22.175
는 192.168.78.16
무엇 입니까 192.168.138.79
? 주소에는 어떻게 도착하나요?
답변1
그 이유는 정적으로 구성된 IP 주소 목록 때문입니다 /etc/NetworkManager/system-connections/name.nmconnection
.