Debian Buster는 고정 IP를 설정할 수 없습니다.

Debian Buster는 고정 IP를 설정할 수 없습니다.

저는 Debian Buster를 실행하는 NPI iMX6ULL ARM 기반 단일 보드 컴퓨터를 가지고 있습니다. 다음 ifconfig과 같이 나열된 2개의 네트워크 포트가 있습니다 .eth0eth1

내 네트워크 구성을 무시하는 것 같습니다./etc/network/interfaces

auto lo eth0 eth1

iface lo inet loopback

iface eth0 inet dhcp

iface eth1 inet static
  address 192.168.1.254
  netmask 255.255.255.0

iface usb0 inet static
    address 192.168.7.2
    netmask 255.255.255.252
    network 192.168.7.0
    gateway 192.168.7.1

위 구성을 시작하고 eth0DHCP 서버에 연결하면 ifconfig다음이 보고됩니다.

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.4.10.131  netmask 255.255.192.0  broadcast 10.4.63.255
        inet6 fe80::d489:7cff:feec:e09e  prefixlen 64  scopeid 0x20<link>
        ether d6:89:7c:ec:e0:9e  txqueuelen 1000  (Ethernet)
        RX packets 478  bytes 42931 (41.9 KiB)
        RX errors 0  dropped 29  overruns 0  frame 0
        TX packets 30  bytes 2883 (2.8 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eth1: flags=-28669<UP,BROADCAST,MULTICAST,DYNAMIC>  mtu 1500
        ether d6:89:7c:ec:e0:9d  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

마찬가지로 eth1위 구성을 시작하고 dhcp 서버에 연결하면 ifconfig다음이 보고됩니다.

eth0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether d6:89:7c:ec:e0:9e  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

eth1: flags=-28605<UP,BROADCAST,RUNNING,MULTICAST,DYNAMIC>  mtu 1500
        inet 10.4.11.126  netmask 255.255.192.0  broadcast 10.4.63.255
        inet6 fe80::d489:7cff:feec:e09d  prefixlen 64  scopeid 0x20<link>
        ether d6:89:7c:ec:e0:9d  txqueuelen 1000  (Ethernet)
        RX packets 1234  bytes 118390 (115.6 KiB)
        RX errors 0  dropped 58  overruns 0  frame 0
        TX packets 38  bytes 3547 (3.4 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

이렇게 하면 sudo ifdown eth1다음과 같이 보고됩니다.

ifdown: interface eth1 not configured

다음과 같이 나타 sudo ifup eth1납니다.

debian@npi:~$ sudo ifup eth1
debian@npi:~$ ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.4.10.131  netmask 255.255.192.0  broadcast 10.4.63.255
        inet6 fe80::d489:7cff:feec:e09e  prefixlen 64  scopeid 0x20<link>
        ether d6:89:7c:ec:e0:9e  txqueuelen 1000  (Ethernet)
        RX packets 16846  bytes 1401257 (1.3 MiB)
        RX errors 0  dropped 856  overruns 0  frame 0
        TX packets 65  bytes 4551 (4.4 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eth1: flags=-28669<UP,BROADCAST,MULTICAST,DYNAMIC>  mtu 1500
        inet 192.168.1.254  netmask 255.255.255.0  broadcast 192.168.1.255
        ether d6:89:7c:ec:e0:9d  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

시작 시 네트워크 구성을 제어하는 ​​것은 무엇입니까? 어떻게 알 수 있나요?

내 MAC 주소 문제에 대한 일부 Google 검색을 찾았지만 이 문제는 두 인터페이스 모두에서 발생합니다. MAC 주소도 변경해 보았으나 아무런 변화가 없었습니다.

답변1

나에게 올바른 방향을 알려준 Seamus에게 감사드립니다. 중요한 점은 내가 사용하고 있는 이미지가 BeagleBone 이미지를 기반으로 한다는 것입니다.

이전 질문은 connman네트워크 포트 제어 에 관한 것이었습니다 networkd. 한 장치에서는 connmandelete 를 사용할 수 있습니다 apt. 그 후 내 구성이 /etc/systemd/network/interfaces올바르게 적용되었습니다.

내 연구에 따르면 이것이 connman앞으로 나아갈 방향이라고 제안했기 때문에 구성 방법도 알아냈습니다. 이것페이지훌륭한 정보가 많이 제공됩니다. connmanctl고정 IP를 설정하는 데 직접 사용할 수 있습니다.

root@npi:~# connmanctl
connmanctl> config ethernet_00142d259a48_cable --ipv4 manual 192.168.10.2 255.255.255.0 192.168.10.1
connmanctl> config ethernet_00142d259a48_cable --nameservers 8.8.8.8
connmanctl> exit

장치 이름 중간에 있는 16진수 문자열은 장치의 MAC 주소입니다. 설명서에는 고정 IP가 지정되어 있으며 숫자는 IP 주소, 넷마스크 및 게이트웨이(게이트웨이는 선택 사항)입니다.

이 페이지에도 아주 잘 설명되어 있습니다. 안타깝게도 대부분의 문서는 Wi-Fi 구성과 관련된 것입니다. 대부분의 웹사이트에서는 정적 주소 지정을 전달할 때만 언급합니다.

이것이 다음 사람에게 도움이 되기를 바랍니다.

관련 정보