/etc/network/interfaces에 대한 설명

/etc/network/interfaces에 대한 설명

/etc/network/interfaces에서 다음 명령이 무엇을 하는지 설명할 수 있는 사람이 있습니까?

up ip link set dev $IFACE up

나는 명령을 이해 ip link하지만 up줄 시작 부분에 무엇을 하고 있습니까? up명령을 나머지 명령에 연결하고 있습니까 ip link set dev $IFACE up?

답변1

에서man interfaces:

IFACE OPTIONS
   The following "command" options are  available  for  every  family  and
   method.   Each of these options can be given multiple times in a single
   stanza, in which case the commands are executed in the order  in  which
   they  appear  in  the stanza.  (You can ensure a command never fails by
   suffixing them with "|| true".)

   pre-up command
          Run command before bringing the interface up.  If  this  command
          fails then ifup aborts, refraining from marking the interface as
          configured, prints an error message, and exits  with  status  0.
          This behavior may change in the future.

   up command

   post-up command
          Run  command  after  bringing the interface up.  If this command
          fails then ifup aborts, refraining from marking the interface as
          configured  (even  though it has really been configured), prints
          an error message, and exits with status 0.   This  behavior  may
          change in the future.

...
There  exists  for  each  of  the  above  mentioned options a directory
/etc/network/if-<option>.d/ the scripts in which are run (with no argu‐
ments)  using  run-parts(8) after the option itself has been processed.
Please note that as post-up and pre-down are aliases, no files  in  the
corresponding  directories  are  processed.  Please use if-up.d and if-
down.d directories instead.

따라서 up시작 부분은 인터페이스가 작동된 후에 명령이 실행된다는 것을 나타내는 데 사용됩니다.

관련 정보