2010年10月26日 星期二

Linux Commands - iproute2

Use ip command to set the ip address

show the ip address eth0
# ip addr | grep eth0
2: eth0: mtu 1500 qdisc pfifo_fast qlen 100
0
inet 20.20.20.1/24 brd 20.20.20.255 scope global eth0
inet 10.0.0.1/24 brd 10.0.0.255 scope global eth0:0

reset the ip-address
# ip addr flush dev eth0

show the ip address eth0
# ip addr | grep eth0
2: eth0: mtu 1500 qdisc pfifo_fast qlen 100
0

set the ip-address eth0
# ip addr add 10.0.0.1/24 brd + dev eth0

show the ip address eth0
# ip addr | grep eth0
2: eth0: mtu 1500 qdisc pfifo_fast qlen 100
0
inet 10.0.0.1/24 brd 10.0.0.255 scope global eth0

沒有留言: