To setup static IP in Debian is a bit difficult as it has no TUI for networking setup. So to setup static IP in Debian, you need to modify file manually.
To setup static IP in Debian follow the steps below:-
Advertisements
- First, we need to modify /etc/networking/interfaces files, so we make a backup before we perform any edit.
$ sudo cp /etc/networking/interfaces /etc/networking/interfaces.bak
** If you do not have this file, you will use /etc/network/interfaces for the above and rest of the steps below
- Then, we edit the file at /etc/networking/interfaces
$ sudo vi /etc/networking/interfaces
- Put in the content below into the file and save it:-
# The loopback interface auto lo iface lo inet loopback # The first network card - this entry was created during the Debian installation # (network, broadcast and gateway are optional) auto eth0 iface eth0 inet static #set your static IP below address 192.168.1.118 #set your default gateway IP here gateway 192.168.1.1 netmask 255.255.255.0 network 192.168.1.0 broadcast 192.168.1.255
- Now, restart your networking setting using the command below
$ /etc/init.d/networking restart
- Once restarted, your Debian will run on new IP. If you are using SSH to configure the above settings, you will get disconnected. No worry, you can now reconnect to Debian using new the IP.
- Done, you have just configure your Debian to run on static IP.
Related posts:
How to enable personal file sharing in Ubuntu 10.04
How to extract .bz2 file in Linux?
How to set print area in Calc - OpenOffice
How to check if directory exists in Bash script
Symfony: PHP Fatal error: Call to a member function setData()
Free Anti Virus for Mac OS X - ClamXav
How to mount samba in Mac OS X / Linux?
Debian: "There is no public key available for the following key IDs"
Share this with your friends:-
Many thanks for this! Fascinating and clear.
I especially like the colourized shell console. What are you using?
thanks
Same as comment above-
Using Lenny, the path for me is: /etc/network/interfaces
In my Debian install (2/12/10) the path to the interfaces file is: /etc/network/interfaces
Good Luck.
TE