한국어
Linux Programming
 

ifconfig 는 대부분 ip 명령으로 대체

makersweb 2022.02.12 15:26 조회 수 : 1493

여전히 ifconfig 를 사용하고 있다면 과거에 살고 있는 것이다.

리눅스에서 ifconfig 가 네트워크기기 정보를 불러오거나, 기기의 IP를 확인하거나, IP를 설정하는 사실상의 표준이었다.

그러나 시간이 지남에 따라 점점 더 많은 기능이 ifconfig 대신 ip 명령으로 대체되었다.

이미 우분투 데스크탑 배포판에는 ifconfig 설치를 중단했고(지금은 여전히 서버에 설치됨), 한동안 net-tools(ifconfig를 제공하는 패키지와 교체된 몇 가지 다른 이전 명령)를 삭제하는 것에 대해 논의해 왔다.

다음은 ifconfig 대신 사용되는 주요 명령이다.

ip address show 간편하게는 ip a

ip link show 간편하게는 ip l

 

다음을 사용하여 장치를 up 또는 down 으로 설정할 수 있다(ifconfig eth0 up 또는 ifconfig eth0 down과 유사).

ip link set eth0 up  또는 ip link set eth0 down

 

그 밖에 ip 명령어를 사용하여 상호작용할 수 있는 다른 옵션이 많이 있다. 이와 관련된 인터넷에 많은 글들을 쉽게 찾을 수 있다.

더 이상 사용되지 않는 Linux 명령 및 대체 명령 시트:

이전 명령(더 이상 사용되지 않음) 새 명령
ifconfig -a ip a
ifconfig eth0 down ip link set eth0 down
ifconfig eth0 up ip link set eth0 up
ifconfig eth0 192.168.2.24 ip addr add 192.168.2.24/24 dev eth0
ifconfig eth0 netmask 255.255.255.0 ip addr add 192.168.1.1/24 dev eth0
ifconfig eth0 mtu 9000 ip link set eth0 mtu 9000
ifconfig eth0:0 192.168.2.25 ip addr add 192.168.2.25/24 dev eth0
netstat ss
netstat -tulpn ss -tulpn
netstat -neopa ss -neopa
netstat -g ip maddr
route ip r
route add -net 192.168.2.0 netmask 255.255.255.0 dev eth0 ip route add 192.168.2.0/24 dev eth0
route add default gw 192.168.2.254 ip route add default via 192.168.2.254
arp -a ip neigh
arp -v ip -s neigh
arp -s 192.168.2.33 1:2:3:4:5:6 ip neigh add 192.168.3.33 lladdr 1:2:3:4:5:6 dev eth0
arp -i eth0 -d 192.168.2.254 ip neigh del 192.168.2.254 dev eth0