# Static IP and DHCP for linux



## klam (Apr 21, 2006)

Hey there,

Cause the mbr of my computer went corrupt I used a knoppix live cd to get to my files and make the backup. The way I figured was the best to make the backup was to connect this computer to a mac that acted as a server. Aaaanywaayyss, I needed to set up this computer running knoppix on DHCP but not being a linux person myself I wasn't able to do it. I googled it but I couldn't find anything that worked out.

I'm just wondering how do I set up a computer for DHCP or static IP on a linux system? Please be gentle with the explaination.. I'm not a linux person.


----------



## CouchMaster (May 26, 2003)

Here's some instructions
http://learnlinux.tsf.org.za/courses/build/net-admin/ch04.html


----------



## lynch (Aug 3, 2002)

With Knoppix, you should be able to use netcardconfig. Just type *sudo netcardconfig* from a command prompt.
Or...
Drill down through the Knoppix program menus; it should be under Network/ Internet> Network card configuration.


----------



## SweetLou (Oct 15, 2004)

Just wondering why you want to back up everything to restore your system? I mean, why not just use Knoppix to fix your MBR?


----------



## lynch (Aug 3, 2002)

SweetLou said:


> Just wondering why you want to back up everything to restore your system? I mean, why not just use Knoppix to fix your MBR?


*sudo install-mbr /dev/hda*
Change hda to appropriate drive.


----------



## klam (Apr 21, 2006)

SweetLou said:


> Just wondering why you want to back up everything to restore your system? I mean, why not just use Knoppix to fix your MBR?


what? well I didn't know it was possible from a knoppix live cd!



> sudo install-mbr /dev/hda
> Change hda to appropriate drive.


Does it matter that the actual OS installed there is Windows and not Linux? working like this:

*sudo install-mbr /dev/c*

Also, lynch thanks a lot. I did see a lot of "sudo netcardconfig" but I wasn't able to use it well I admit my level in *nix systems are almost non-existent... say, if I have my computer on DHCP and I boot it from knoppix live cd, how would I change it for a static ip, say 190.23.65.34


----------



## lynch (Aug 3, 2002)

You're using a Linux program so "/dev / c", a windows name, means nothing to it. If you have one hard drive on the primary master controller then it /dev/hda ; hence , sudo install-mbr /dev/hda.
You use netcardconfig to choose either static or dhcp. The command syntax to do it manually is *ifconfig eth0 <ipaddress>.*
For adding a default gateway, type *route add default gw <ipaddress>*
To add dns servers, edit the /etc/resolv.conf file as root:

```
nameserver <dns_server_address>
```
Like nameserver 65.76.89.123


----------



## klam (Apr 21, 2006)

Excellent, thanks a lot :up:


----------

