ubuntu临时修改ip,mac的方法示例时间:2023-03-09 15:57:59 ifconfig eth0 down ifconfig eth0 154.84.28.148 netmask 255.255.255.0 route add default gw 154.84.28.254 ifconfig eth0 hw ether AA:AA:AA:AA:AA:AA ifconfig eth0 up 然后将这个脚本保存成一个文件,我这里假设取名为test.sh。 则在命令行执行sudo bash test.sh来生效。