Page 1 of 3 123 LastLast
Results 1 to 10 of 30

Thread: dhcp settings

  1. #1
    Join Date
    Jul 2012
    Beans
    64

    dhcp settings

    I have just installed ubuntu 12.04, after installation the guide says I must install 'vim' and also Ubuntu installer has configured our system to get its network settings via DHCP, Now we will change that to a static IP address for this you need to edit

    Edit /etc/network/interfaces and enter your ip address details (in this example setup I will use the IP address 172.19.0.10): Why do I have to do this and how? Do I just type in /etc/network/interfaces and press enter or do I have to look for a line to physically edit?

  2. #2
    Join Date
    Nov 2005
    Location
    Lincolnshire, UK
    Beans
    1,461
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: dgcp settings

    evertonmint: I don't know which "guide" you are referring to but I doubt if you must install vim! This, along with emacs, is a very powerful text editor that, while useful to developers and "power users", is really too cryptic for general use. When you do need to use a text editor then I suggest you use either "gedit" (for GUI use) or "nano" (for CLI terminal use). Both of these editors are far more intuitive and should provide all the capability you need. Just remember that if you are editing system files (i.e. those owned by "root") then you must use the prefix "gksudo" for gedit or "sudo" for nano, as this allows you to save files as the superuser.

    The default network settings should be DHCP so if you want to change this to a static IP you can do this via the /etc/network/interfaces file. If you wish to do this then I suggest you first copy the original file so that you have a good backup:
    Code:
    sudo cp /etc/network/interfaces /etc/network/interfaces_bak
    Then edit the file with the "nano" text editor:
    Code:
    sudo nano /etc/network/interfaces
    The editor will then show the existing file and you should change it as required. e.g.
    Code:
    auto lo
    iface lo inet loopback
    
    #iface eth0 inet dhcp
    
    iface eth0 inet static
    address 172.19.0.10  #This should show your static IP
    netmask 255.255.255.0
    gateway 172.19.0.1  #This should show your router address
    
    auto eth0
    (Note that "#" signifies comments that are to be ignored)

    Save the file with Ctrl-o then quit nano with Ctrl-x.

    Reboot the PC and you should now have your required static IP.

    Note that editing the /etc/network/interfaces file is a rather "old fashioned" way of specifying connections as later versions of Ubuntu use the "Network Manager" GUI to do this. Personally, I prefer to edit the interfaces file as I find this more reliable than using the NM widget.

  3. #3
    Join Date
    Jul 2012
    Beans
    64

    Re: dgcp settings

    Quote Originally Posted by Zill View Post
    evertonmint: I don't know which "guide" you are referring to but I doubt if you must install vim! This, along with emacs, is a very powerful text editor that, while useful to developers and "power users", is really too cryptic for general use. When you do need to use a text editor then I suggest you use either "gedit" (for GUI use) or "nano" (for CLI terminal use). Both of these editors are far more intuitive and should provide all the capability you need. Just remember that if you are editing system files (i.e. those owned by "root") then you must use the prefix "gksudo" for gedit or "sudo" for nano, as this allows you to save files as the superuser.

    The default network settings should be DHCP so if you want to change this to a static IP you can do this via the /etc/network/interfaces file. If you wish to do this then I suggest you first copy the original file so that you have a good backup:
    Code:
    sudo cp /etc/network/interfaces /etc/network/interfaces_bak
    Then edit the file with the "nano" text editor:
    Code:
    sudo nano /etc/network/interfaces
    The editor will then show the existing file and you should change it as required. e.g.
    Code:
    auto lo
    iface lo inet loopback
    
    #iface eth0 inet dhcp
    
    iface eth0 inet static
    address 172.19.0.10  #This should show your static IP
    netmask 255.255.255.0
    gateway 172.19.0.1  #This should show your router address
    
    auto eth0
    (Note that "#" signifies comments that are to be ignored)

    Save the file with Ctrl-o then quit nano with Ctrl-x.

    Reboot the PC and you should now have your required static IP.

    Note that editing the /etc/network/interfaces file is a rather "old fashioned" way of specifying connections as later versions of Ubuntu use the "Network Manager" GUI to do this. Personally, I prefer to edit the interfaces file as I find this more reliable than using the NM widget.
    Thx for that Zill, the guide is the 'step by step Ubumtu 12.04 (precise) here is an extraction;
    This will complete the Ubuntu 12.04 (Precise) LAMP Server Installation and your server is ready for installing applications which supports apache,mysql and php.

    Configuring Static ip address in Ubuntu server

    If you want to install vim editor use the following command

    sudo apt-get install vim

    Ubuntu installer has configured our system to get its network settings via DHCP, Now we will change that to a static IP address for this you need to edit

    Edit /etc/network/interfaces and enter your ip address details (in this example setup I will use the IP address 172.19.0.10):

    sudo vi /etc/network/interfaces

    and enter the following save the file and exit (In vi, ESC, then ZZ to save and exit)

    # The primary network interface

    auto eth0
    iface eth0 inet static
    address 172.19.0.10
    netmask 255.255.255.0
    network 172.19.0.0
    broadcast 172.19.0.255
    gateway 172.19.0.1

    I am a newbie especially to dos, the server is a second hand HP ML 310 with no O/S till now. The guide doesn't explain why I need a static IP? I have a couple of wyse (used) terminals attached, that need to be set up also.

  4. #4
    Join Date
    Nov 2005
    Location
    Lincolnshire, UK
    Beans
    1,461
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: dgcp settings

    Quote Originally Posted by evertonmint View Post
    ...I am a newbie especially to dos, the server is a second hand HP ML 310 with no O/S till now. The guide doesn't explain why I need a static IP? I have a couple of wyse (used) terminals attached, that need to be set up also.
    Let's just rewind a bit. I have taken a look at your previous posts where you referred to "freeDOS" and you have also referred to "dos" in this thread. FYI, Ubuntu (and all Linux systems) do not run "dos" as this is a Microsoft thing. When accessing a Linux system via a terminal, the OS commands can look similar to MS DOS but the commands and usage are totally different and, arguably, more powerful. e.g. To list a directory in DOS you use the "dir" command whereas in Linux you use the "ls" command.

    Assuming you did manage to install Ubuntu, it seems that you wanted the server version. May I ask why you specifically wanted this version? The reason for the question is that both the "desktop" and the "server" versions are fundamentally similar and each one can perform the same functions. The primary difference is the desktop version has a GUI by default, whereas the server version does not - all commands must be entered via a terminal. However, simply by adding packages, identical functionality can be added to both versions.

    If need to run a server exclusively then it is probably best to install the server version, as this has many server packages installed by default. However, if you either want to use the PC for other tasks that require a GUI (such as web browsing), or, if you want the ease of use from using a GUI, then the desktop version may be a better bet. Then you just need to add a few server packages.

    If you need to ask "why I need a static IP?" then I suggest that you may not need one! With servers, these are often desirable to ensure consistent network routing. With desktops this is not normally required as DHCP (dynamic IP) is perfectly adequate.

    I suggest you advise exactly what you are trying to achieve here and, in particular, what kind of data you wish to distribute. e.g. Are you just wishing to share files to other PCs or do you wish to run a full web server etc. Specifically, are you intending to share files locally (within your LAN) or globally (via the internet)?

    How much knowledge do you currently have of server administration e.g. on Windows?

  5. #5
    Join Date
    Jul 2012
    Beans
    64

    Re: dgcp settings

    Hi again Zill and thanks for the prompt replies,
    We have a little 8 office unit with a possibility of 40+ terminals the intent is mainly local lan based pc's but with the capacity to go global. We also have another office at the other end of town in Jaguar, what was Ford Halewood. My knowledge on servers is very limited. We thought it would be nice to be able to access files at both places rather than sending emails. Reading your reply it would be advantageous to us to place ubuntu desktop on the server also, as I would be more at home with a gui functionality.
    All advice is gratefully accepted.
    Regards
    evertonmint
    Last edited by evertonmint; July 29th, 2012 at 06:24 PM.

  6. #6
    Join Date
    Nov 2005
    Location
    Lincolnshire, UK
    Beans
    1,461
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: dhcp settings

    evertonmint: Thank you for the additional info. It seems that your primary requirement is to share files to other PCs via your LAN. If your network only uses Linux PCs then I suggest Network File System (NFS) is the best way to do this. However, if your network includes any Windows PCs then you should use Samba as this works with both Linux and Windows.

    Both NFS and Samba will be fine to share files across your LAN but if you need to share files to other sites (eg. via the internet) then I believe you will need to use a Virtual Private Network (VPN).

    While using a single file server can be a good idea I suggest you remember that you will then be "putting all your eggs in one basket". As such, you must have a reliable system to back up all your data on a very regular basis. You will also need to have redundancy within the system so that, in the event of your server failing, you can rapidly bring a replacement machine on line.

    The other main factor to consider is security. While Linux systems within a LAN are generally very secure, the risk of attack increases considerably when you open ports to the internet. This risk increases if you introduce more services, such as web servers etc.

    Linux servers are very secure by design but this can be negated by bad configuration by the administrator. As you have said that you have limited knowledge of server administration I therefore strongly recommend that you obtain the assistance of a Linux "guru" in the initial configuration and administration.

    Going back to your original post, I suggest you need to map out exactly how you will configure your network. Personally, I use static IPs for each PC as this makes configuration simpler on my home LAN (running NFS). However, as yours is a larger "enterprise level" system, you may find other methods of addressing your PCs more suitable. Unfortunately, I am hitting the limits of my knowledge here so I hope others can now pick this thread up with more info.

  7. #7
    Join Date
    Jul 2012
    Beans
    64

    Re: dhcp settings

    Thanks for your help and advice Zill, I will certainly take it on board.
    So a quick recap, I would be most suited to downloading:Samba, a VPN and a security, maybe also a DNS server and configure a static IP. Going back to my 1st post, I don't need VIM? Would it make any difference in the 'address' if eth0 was plugged direct into the router rather than the switch?
    Again thanks.

    Regards
    evertonmint

  8. #8
    Join Date
    Nov 2005
    Location
    Lincolnshire, UK
    Beans
    1,461
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: dhcp settings

    evertonmint: You have referred to "downloading" various apps. Although technically correct, in Linux we refer to installing a package, which automatically includes the "downloading" part. This is because Linux apps are held on centralised repositories (repos), rather than scattered around the WWW as with Windows apps. As Linux uses a package management system this means that, in addition to the core program, any required dependencies, such as libraries, are also installed automatically.

    As stated earlier, if you use only Windows clients, or a mix of Linux and Windows, then a Samba server is the way to go. However, NFS is, IMHO, preferable if your network only uses Linux clients.

    I do not understand what you mean by "a security" as there is no single application that provides security. Network security is a specialised subject that involves many different tools that all have to be configured correctly. As each network (and its server applications) is different each one needs expert knowledge to ensure good security. I suggest you should read-up on this and, as suggested earlier, obtain help from a Linux guru.

    Unless you intend running a web-server, I doubt if you need a DNS server. From a security viewpoint, the fewer servers you run the better as each one is an additional security risk that needs hardening.

    While it might be possible to run servers with dynamic IP addresses, in my view a static IP would make things far simpler. I explained how to do this in my post #2 above.

    You can, if you wish, use the vim editor. However, this is unnecessary in my view as other editors out there are perfectly adequate for your purposes and more intuitive! Nano is installed by default and is a really simple command-line editor that is ideal for your usage IMHO.
    Would it make any difference in the 'address' if eth0 was plugged direct into the router rather than the switch?
    I don't know how your network is currently configured and so I cannot really comment on this one. You need to establish what range of IP addresses you wish to use and then configure your router, server(s) and clients accordingly. Router IP address configuration is generally done via a web-browser and the server/client PCs can be configured either by editing the /etc/network/interfaces file or via a GUI on each machine.

  9. #9
    Join Date
    Jul 2012
    Beans
    64

    Re: dhcp settings

    Zill, Thanks for the technical heads up, I installed ubuntu 12.04 and also installed a couple of packages namely; OpenSSH, LAMP, print and Samba.When I entered the sudo cp /etc/network/interfaces /etc/network/interfaces_bak, it came back 'do not recognise _bak'?
    I tried that sudo nano code and it open up in another page/file, with a grey header titled GWH or something like that, anyway I typed in the code but it wouldn't save, I eventually got out and back to home page, so I entered the sudo vi/etc/ code and the code you gave above came up with the # tag lines in turquoise blue. I editor'd the code and saved but,a line came up some interfaces may not work 'it didn't recognise a line' some components of interfaces may not work. I had to leave the office here so will look at it tomorrow.
    Yes, I understand the security has to be set up when addressing the terminals and writing the plan. Can I install ubuntu 'desktop' on top of the server?

    I have now come in and couldn't get the info I needed so I reinstalled the whole program again, at least now it is fresh. It is telling me 120 packages can be updated and 55 of these are security updates.
    Again thanks for help and advice.

    Regards
    evertonmint
    Last edited by evertonmint; July 31st, 2012 at 10:52 AM.

  10. #10
    Join Date
    Nov 2005
    Location
    Lincolnshire, UK
    Beans
    1,461
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: dhcp settings

    evertonmint: I don't understand the error you received in copying the original /etc/network/interfaces file as you can specify any filename for the copy! I suggest you check the syntax is exactly as I gave it, preferably by copy & paste from this forum. Similarly, if you get any error messages then please paste them here with "CODE" tags.

    To save a file with Nano, hit "Ctrl-o", followed by "Ctrl-x" to exit.

    Similarly, please paste any errors here in full as it is easier to see what is happening with all the text.

    Yes, you should be able to install Ubuntu Desktop.

Page 1 of 3 123 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •