DEV Community

rafaone
rafaone

Posted on

Linux Shell Script set fixed IP

Simple shell script to up the ethernet card on specific IP.

ifconfig eth0 down;             
ifconfig eth0 141.1.89.151  netmask  255.255.128.0 up;
route add default gw 141.1.47.142  eth0;

Enter fullscreen mode Exit fullscreen mode

eth0: the interface of ethernetcard

Top comments (0)