changeubuntuserverfromdhcptoastaticipaddress
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
changeubuntuserverfromdhcptoastaticipaddress [2013/07/05 19:06] – deftesprit | changeubuntuserverfromdhcptoastaticipaddress [2013/07/05 19:07] (current) – deftesprit | ||
---|---|---|---|
Line 6: | Line 6: | ||
Let's open up the / | Let's open up the / | ||
- | <blockquote>sudo nano / | + | <code>sudo nano / |
For the primary interface, which is usually eth0, you will see these lines: | For the primary interface, which is usually eth0, you will see these lines: | ||
- | <blockquote>auto eth0 | + | <code>auto eth0 |
iface eth0 inet dhcp | iface eth0 inet dhcp | ||
- | </blockquote> | + | </code> |
As you can see, it's using DHCP right now. We are going to change dhcp to static, and then there are a number of options that should be added below it. Obviously you'd customize this to your network. | As you can see, it's using DHCP right now. We are going to change dhcp to static, and then there are a number of options that should be added below it. Obviously you'd customize this to your network. | ||
- | <blockquote>auto eth0 | + | <code>auto eth0 |
iface eth0 inet static | iface eth0 inet static | ||
- | & | + | |
- | & | + | netmask 255.255.255.0 |
- | & | + | network 192.168.1.0 |
- | & | + | broadcast 192.168.1.255 |
- | & | + | gateway 192.168.1.1 |
- | </blockquote> | + | </code> |
Now we'll need to add in the DNS settings by editing the resolv.conf file: | Now we'll need to add in the DNS settings by editing the resolv.conf file: | ||
- | <blockquote>sudo nano / | + | <code>sudo nano / |
On the line ' | On the line ' | ||
You need to also remove the dhcp client for this to stick (thanks to Peter for noticing). You might need to remove dhcp-client3 instead. | You need to also remove the dhcp client for this to stick (thanks to Peter for noticing). You might need to remove dhcp-client3 instead. | ||
- | <blockquote> | + | <code> |
sudo apt-get remove dhcp-client< | sudo apt-get remove dhcp-client< | ||
//OR_<br /> | //OR_<br /> | ||
sudo apt-get remove isc-dhcp-client | sudo apt-get remove isc-dhcp-client | ||
- | </blockquote> | + | </code> |
Now we'll just need to restart the networking components: | Now we'll just need to restart the networking components: | ||
- | <blockquote>sudo / | + | <code>sudo / |
- | </blockquote> | + | </code> |
Ping www.google.com. If you get a response, name resolution is working(unless of course if google is in your hosts file). | Ping www.google.com. If you get a response, name resolution is working(unless of course if google is in your hosts file). | ||
changeubuntuserverfromdhcptoastaticipaddress.txt · Last modified: 2013/07/05 19:07 by deftesprit