Thursday, November 29, 2018

How to change Ubuntu from DHCP to Static IP Address


  • Open the /etc/network/interfaces file :-
        ==> sudo nano /etc/network/interfaces

  • You can see the following lines in interfaces file :-
        ==> auto eth0
                iface eth0 inet dhcp

  • Change the following lines :-
        ==> auto eth0
                iface eth0 inet static
                address 192.168.1.11
                netmask 255.255.255.0
                network 192.168.1.0
                broadcast 192.168.1.255
                gateway 192.168.1.1
                dns-nameservers 8.8.8.8

  • Then reboot the server.

        

No comments:

Post a Comment