It’s a bit different from what we’re used to do in Ubuntu, here are the instructions, assuming our network interface is eth0:
- Take a backup from the “/etc/sysconfig/network-scripts/ifcfg-eth0” file, e.g. by the following command: “cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth0.bak”
- Open the “/etc/sysconfig/network-scripts/ifcfg-eth0” file for editing using vi or similar and do the following:
- change BOOTPROTO from “dhcp” to “static”
- Add the following lines replacing the “X” with your values:
Note: You can add more “DNS1” entries to add additional DNS servers
- Restart the network:
That’s it! Enjoy!