DEV Community

rafaone
rafaone

Posted on

2

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)

👋 Kindness is contagious

Immerse yourself in a wealth of knowledge with this piece, supported by the inclusive DEV Community—every developer, no matter where they are in their journey, is invited to contribute to our collective wisdom.

A simple “thank you” goes a long way—express your gratitude below in the comments!

Gathering insights enriches our journey on DEV and fortifies our community ties. Did you find this article valuable? Taking a moment to thank the author can have a significant impact.

Okay