2022年9月9日星期五

Linux ifconfig

#change network info 

#first reset a IP
ifconfig eth0 192.168.1.123 
#second reset netmask and broadcast for IP. 
ifconfig eth0 192.168.1.123 netmask 255.255.0.0 broadcast 192.168.1.255

#before change MAC, stop the network-adapter ethX.  
ifconfig eth0 down 

#third reset ether MAC for eth0
ifconfig eth0 hw ether 00:11:22:33:44:55
ifconfig eth0 up    #restart eth0

#request DHCP server for new IP
dhclient eth0 

#linux dns conf
more /etc/resolv.conf

 



没有评论: