랜선끼고 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.
'Linux' 카테고리의 다른 글
[cut] 명령어 -f 옵션으로 가장 왼쪽에 있는 마지막 필드 가져오기 (1764) | 2017.04.07 |
---|---|
[문자열 자르기] awk, cut을 이용 (1440) | 2017.04.06 |
[UDP] 특성 (1796) | 2016.12.06 |
[Linux] Bonding 본딩 설정 (1281) | 2016.12.05 |
[SQlite3] 자주쓰는 명령어 (448) | 2016.11.23 |