리눅스 IP 관리 명령 모음

|

 

@ ifconfig

ifconfig eth0 up //eth0 활성화
ifconfig eth0 down  //eth0 비활성화
ifconfig eth0 10.10.1.1 // ip변경
ifconfig eth0 netmast 255.255.255.0  //넷마스크 변경
ifconfig eth0 broadcast 10.10.0.255  //broadcast 변경
ifconfig eth0 10.10.1.1 netmast 255.255.255.0 broadcast 10.10.0.255  //동시 명령
ifconfig eth0:0 10.10.1.1  가상 인터페이스 설정

 

@ ip

ip addr show  //network 정보 조회
ip addr add 10.10.1.1/24 dev eth0 // ip등록
ip addr del 10.10.1.1/24 dev eth0 // ip삭제
ip link set eth0 up  //eth0 활성화
ip link set eth0 down //eth0 비활성화
ip route show  //라우터 정보 확인
ip route add default via 10.10.1.254 //게이트웨이 설정
ip route del default via 10.10.1.254 //게이트웨이 삭제
ip route add 10.10.1.0/24 via 10.10.1.1 dev eth0 //라우팅정보 등록
ip route del 10.20.1.0/24 //라우팅정보 삭제
 

@ ifup / ifdown

ifup eth0  //eth0 활성화
ifdown eth0  //eth0 비활성화
 

@ ethtool

ethtool -i eth0  //nic 카드 드라이버 정보
ethtool eth0  //nic 카드 설정/동작 정보
ethtool -s eth0 speed 1000 duplex full  //nic 카드 속도/동작방식 세팅
ethtool -s eth0 speed 100 duplex half autoneg off //nic 카드 속도/동작방식 세팅 #2
And