랜선끼고 ifup or ifconfig eth$N up
IFF_UP = 1 // Interface is up
IFF_RUNNING = 1 // Resources allocated

랜선끼고 ifdown or ifconfig eth$N down
IFF_UP = 0 // Interface is up
IFF_RUNNING = 0 // Resources allocated

랜선뽑고 ifup or ifconfig eth$N up
IFF_UP = 1 // Interface is up
IFF_RUNNING = 0 // Resources allocated

랜선뽑고 ifdown or ifconfig eth$N down
IFF_UP = 0 // Interface is up
IFF_RUNNING = 0 // Resources allocated



그렇다면 if, ifconfig 명령의 차이는?

RHET5 기준 (https://access.redhat.com/solutions/27166)



  • An "ifconfig" command and "ifup" or "ifdown" command can activate network interfaces. "ifconfig" directly controls network interfaces, however "ifup" or "ifdown" executes "/etc/sysconfig/network-scripts/ifup-" or "ifdown-" scripts. The scripts use an ip command.

  • "ifconfig" and "ip" commands use ioctl() to activate or deactivate network interfaces. "ifconfig" flags network interfaces 'IFF_UP | IFF_RUNNING', however "ip" flags that 'IFF_UP'.

  • An "ifconfig up eth0" activates eth0 but does not setup IP addresses, however an "ifup eth0" setup IP addresses or other options based by an ifcfg-eth0, because the "ifup" uses an "ifup-eth*" script.

  • The ifup command will also configure any static routes that are configured in the network-scripts directory. The ifconfig command will not.


반응형

+ Recent posts