Howto: Ubuntu Linux convert DHCP network configuration to static IP configuration

My friend wanted to know how to change or convert DHCP network configuration to static configuration. After initial installation, he wanted to change network settings. Further, his system is w/o GUI system aka X Windows. Here is quick way to accomplish the same:

ADVERTISEMENTS

Your main network configuration file is /etc/network/interfaces

Desired new sample settings:
=> Host IP address 192.168.1.100
=> Netmask: 255.255.255.0
=> Network ID: 192.168.1.0
=> Broadcast IP: 192.168.1.255
=> Gateway/Router IP: 192.168.1.254
=> DNS Server: 192.168.1.254

Open network configuration file
$ sudo vi /etc/network/interfacesOR$ sudo nano /etc/network/interfaces

Find and remove dhcp entry:
iface eth0 inet dhcp

Append new network settings:

iface eth0 inet static
address 192.168.1.100
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.254

Save and close the file. Restart the network:
$ sudo /etc/init.d/networking restart

Task: Define new DNS servers

Open /etc/resolv.conf file
$ sudo vi /etc/resolv.conf

You need to remove old DNS server assigned by DHCP server:
search myisp.com
nameserver 192.168.1.254
nameserver 202.54.1.20
nameserver 202.54.1.30

Save and close the file.

Task: Test DNS server

$ host cyberciti.biz

Network command line cheat sheet

You can also use commands to change settings. Please note that these settings are temporary and not the permanent. Use above method to make network changes permanent or GUI tool as described below.

Task: Display network interface information

$ ifconfig

Task: Take down network interface eth0 / take a network interface down

$ sudo ifconfig eth0 downOR $ sudo ifdown eth0

Task: Bring a network interface eth0 up

$ sudo ifconfig eth0 upOR$ sudo ifup eth0

Task: Change IP address and netmask from command line

Activate network interface eth0 with a new IP (192.168.1.50) / netmask:
$ sudo ifconfig eth0 192.168.1.50 netmask 255.255.255.0 up

Task: Display the routing table

$ /sbin/route OR$ /sbin/route -n
Output:

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
localnet        *               255.255.255.0   U     0      0        0 ra0
172.16.114.0    *               255.255.255.0   U     0      0        0 eth0
172.16.236.0    *               255.255.255.0   U     0      0        0 eth1
default         192.168.1.254   0.0.0.0         UG    0      0        0 ra0

Task: Add a new gateway

$ sudo route add default gw 172.16.236.0

Task: Display current active Internet connections (servers and established connection)

$ netstat -nat

Task: Display open ports

$ sudo netstat -tulpOR$ sudo netstat -tulpn

Task: Display network interfaces stats (RX/TX etc)

$ netstat -i

Task: Display output for active/established connections only

$ netstat -e
$ netstat -te
$ netstat -tue

Where,

  • -t : TCP connections
  • -u : UDP connections
  • -e : Established

Task: Test network connectivity

Send ICMP ECHO_REQUEST to network hosts, routers, servers etc with ping command. This verifies connectivity exists between local host and remote network system:
$ ping router
$ ping 192.168.1.254
$ ping cyberciti.biz

See simple Linux system monitoring with ping command and scripts for more information.

Task: Use GUI (Graphical Configuration) network Tool

If you are new, use GUI configuration tool, type the following command at terminal:
$ network-admin &

Above command is Ubuntu’s GUI for configuring network connections tool.

Final tip – Learn how find out more information about commands

A man page is your best friend when you wanted to learn more about particular command or syntax. For example, read detailed information about ifconfig and netstat command:
$ man ifconfig
$ man netstat

Just get a short help with all command options by appending –help option to each command:
$ netstat --help

Find out what command is used for particular task by searching the short descriptions and manual page names for the keyword:
$ man -k 'delete directory'
$ apropos -s 1 remove

Display short descriptions of a command:
$ whatis rm
$ whatis netstat

Linux offers an excellent collection of utilities, which can be use to finding the files and executables, remember you cannot memorize all the commands and files 😉

🐧 Get the latest tutorials on SysAdmin, Linux/Unix, Open Source & DevOps topics via:
CategoryList of Unix and Linux commands
File Managementcat
Network Utilitiesdig host ip nmap
Package Managerapk apt
Processes Managementbg chroot disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w

ADVERTISEMENTS
84 comments… add one
  • George Dec 17, 2006 @ 12:17

    Thank you nixcraft!

    You are not only teaching excellent networking specifics, but, most importantly, also making me understand how to do this on my own. Not too many guys out there are able to do this as you have done.

    • MyqNels May 16, 2012 @ 22:24

      Well thanks for the lecture easy enough. i am a newbie to ubuntu but am catching up. thanks

  • Rafael Jul 30, 2007 @ 5:44

    Thank you, this made it work for me. I had the problem of needing to use static ip address, for various other lan requirements.

    Although, one minor glitch creeped up .. after I had edited the /etc/network file. My gateway is set to 192.168.1.1, rather than … 1.254, and so that is what I had set in the network file. After editing this file I still had no internet connection, but I could ping the gateway. But I was able to connect after modifying the setting in the gui: System–>Admin–>Network–>eth0–>gateway address. It had a default setting of 192.168.1.254, changing it to my actual gateway fixed it.

  • Grady Lambert Aug 17, 2007 @ 1:32

    A very good tutorial. Thank you.
    I have been struggling with networking for sometime. You have helped to clear up a lot of confusion.

  • Shelly Sep 10, 2007 @ 8:31

    Hi and thanks for this article.
    Why do you change the 255 to 254 please?
    Do I need to do that if setting a server box up within a network with other multiple OS’s?

    • reply Dec 15, 2010 @ 8:17

      With the netmask for that network the address 255 is the broadcast address= sends to all machines on that network. 254 addresses are available from 192.168.1. 1 254.

  • steppa Oct 12, 2007 @ 17:31

    NetworkManager is fine for varying wlan configurations. This guide gives a sleek way to configure a static network. Afterwards you can

    apt-get –purge remove network-manager knetworkmanager network-manager-gnome dhcdbd

    to get rid of unnecessarily runnig daemons.

  • Anonymous Dec 8, 2007 @ 4:07

    auto eth0 should precede anything added to “interfaces” and be on its own line.

  • Grayheart Jan 30, 2008 @ 19:43

    one small problem… if you edit /etc/resolv.conf directly, the next time you ifdown or ifup an interface or reboot for that matter your settings are lost. In Ubuntu the resolv.conf is generated each time you up/down an interface. So unless you removed the resolvconf package which is generally installed by default, you need to add proper dns- entries to the /etc/network/interfaces file to make changes permanent. eg:
    iface eth0 inet static
    address 192.168.1.100
    netmask 255.255.255.0
    network 192.168.1.0
    broadcast 192.168.1.255
    gateway 192.168.1.254
    # dns-* options are implemented by the resolvconf package, if installed
    dns-nameservers 192.168.1.254
    dns-search myisp.com

    • ActionParsnip Nov 15, 2010 @ 1:15

      Not strictly. You can uninstall network-manager and it will need to be manually opulated and will not be generated at all. In a default install maybe, but there are situations which are very common where the file will not be touched

      • Peter Dec 30, 2012 @ 1:14

        Look at man page for resolvconf, this indicates one proper way to add nameservers is via the dns-nameservers in the interfaces config file and NOT by editing /etc/resolve.conf since that file is generated by the system. The /etc/resolv.conf should not be edited directly (at least on my Ubuntu 12.10 server).

  • G7 Feb 1, 2008 @ 7:39

    About dns-nameservers: if you have >1 dns servers they must be in 1 line separated by spaces. But not in 2-3 lines (it will hangup network startup script at all) !!!

  • Raj Feb 1, 2008 @ 13:54

    I think only dhclient updates resolv.conf, look like ubuntu has some additional scripting at /etc/rc.d/*. On a side note, you can write protect resolv.conf
    sudo chattr +i /etc/resolv.conf
    man chattr

    • Jeremy Sep 7, 2010 @ 1:24

      Thank you thank you, never seen chattr somehow. Dangerous, but awesome, especially with setuid(0) programs.

  • pankaj Mar 8, 2008 @ 8:39

    How can i encrypted the file from VI. And how can i connect the internet in my home and I want also connect the localarea network. And what is joe editor explane.

  • pankaj Mar 8, 2008 @ 8:42

    How can i configer the server connection on my one more system If i would like the 1st system is an Administrator…..

  • polarizer Apr 1, 2008 @ 12:45

    This was very useful to me cause i wasn’t able to find a way to accomplish that via dpkg-reconfigure or debconf.

    thx for sharing

    the polarizer

  • danny0085 Apr 8, 2008 @ 19:29

    a litle tutorial to how to configure DHCP

    dhcp

  • Tauxz Jun 4, 2008 @ 6:28

    how to i restart network

    i used:
    sudo /etc/init.d/networking restart

    /etc/init.d/networking restart

    bu still nothing happening,
    pls can you help me.

  • Tinapa Faletiute Jun 16, 2008 @ 8:18

    How to save after changing something in the terminal window for ubuntu 7.04?

  • Rim Jun 25, 2008 @ 16:03

    This was incredibly helpful. I am a very experienced Windows admin but I still feel like a newbie when it comes to Linux. Not only did I complete the task I needed with your help, you also made me realize the difference between editing config files and just using ifconfig.

    Bookmarking your site.

  • Ray Malone Jul 4, 2008 @ 18:35

    I have just started with Linux with ubuntu server 8.94. Never used Linux before.
    Just wanted to say thank you. Wanted to use Fixed Ip for the server and found your site and great instructions easily.

    Just wanted to say thanks.

  • dido Jul 5, 2008 @ 9:11

    Excellent. Thanks.

  • Randy Jul 18, 2008 @ 2:06

    Oh wow. Thank you so much for this tip!

  • ernest Jul 28, 2008 @ 3:10

    thanks for the tip. i think it’s working with my server :).

    when you have time, can you explain what these do (in resolv.conf):
    search myisp.com
    nameserver 192.168.1.254

    thanks!!

  • Jason Jul 30, 2008 @ 11:43

    Thank you.

    Linux newbie here but slowly & surely getting there – your guide did exactly what I needed.

    Thanks.

    Only odd thing for me was the instance of Ubuntu (JeOS 8.04.1 on VMWare ESX Server) only saw eth1 and not eth0 – however the process still worked.

    Cheers.

  • David Aug 11, 2008 @ 13:27

    This won’t work, Wlan0 does not show up in this file. Where can I edit for Wlan0?

  • George Aug 25, 2008 @ 9:17

    This has helped me set-up the ethernet interface for my new ubuntu installation

  • Beyboo Nov 9, 2008 @ 6:46

    This is really excellent stuff. No wise guy talk, plain guru speak. I have saved this page as a PDF and am gonna use it for my future references. I am a Ubuntu Gnome user and am trying out Kubuntu Ibex (and KDE) for the first time. Its really a pain to set it up 🙁

  • dave beall Nov 18, 2008 @ 6:35

    thank you for your time and this post..you helped me get this project going…
    it’s people like you that are willing to help us newbies that makes the internet an invaluable tool.

  • David Nov 18, 2008 @ 16:32

    and still my question goes unanswered, wlan0 does not exist in this file. Apparently wanting to help newbies is not the goal here =

  • Richard Dec 9, 2008 @ 15:30

    Excellent Info. Thanks for all your help.

  • Jackal Jan 3, 2009 @ 13:00

    I am total new to ubuntu server 8.04… we are runnining a wireless network cross country and sharing one router to exit to the internet…. Our lan use an ip range of 192.168.1.0 to 192.168.255 …. Now our present intranet works fine in windows but we are considdering changing to ubuntu …. we presently use pppeoe to access the internet….my server ip address i need to setup to 192.168.1.40 …. our internet router is presently set to 192.168.1.200…. submask 255.255.255.0 ….Default gateway 192.168.1.200….My ubuntu server is now a barebone server…is there a step by step method tutorial of how to make my server work as a local intranet and international internet multiple web, email, and hosting server
    Please email me

  • anuu Feb 17, 2009 @ 11:54

    hmn its good tutorial,
    can u add litle bit explanations to:
    i setup lan and Internet sharing to my sisters pc and my laptop – and that’s all, but I’m actually don’t know much about correct netmasking, ip, i mean how to choose correct those:
    i mean ip: starting with 172 or 192 or 10 what differences ?
    i mean netmask 255.255.0.0 or 255.255.255.0 or.. ?

    thank you

  • ian Feb 20, 2009 @ 7:19

    Hi,
    I am new to networking. Can someone help me? I have a situation where I have two NIC cards in my Blade server. I have an Ethernet cable that comes from the router plugged into one of the NIC cards (that works and provides internet access for the blade server running Ubuntu 8.04). What I want to do since my second Ethernet cable is very short, is connect one end of the short cable to the second NIC card on the Blade server, and connect the other end of the short cable to the NIC card on my Windows Server 2003 so I can access the internet from the Windows machine. How do I go about getting the Windows server to access the internet? What configurations do I need to do on the Blade server and Windows server to make everything work? Your help is greatly appreciated. Thx!

  • anuu Feb 20, 2009 @ 20:18

    ian
    setup ip_forward to on
    echo “1” > /proc/sys/net/ipv4/ip_forward
    and setup POSTROUTING, MASQUERADE to CARD2 that will share net to win
    /sbin/iptables -t nat -A POSTROUTING -o eth0 -s CARD2IPHERE -j MASQUERADE

    hm i think that’s all

  • Ravi Feb 23, 2009 @ 17:25

    Nice tutorial. Thanks and Keep it up.

  • Ali Raza Mar 17, 2009 @ 4:21

    thanx

  • Philip Apr 2, 2009 @ 22:23

    Thank you for this website.

    I come from Window and this is my first time doing static IP on my LAN on a Linux. I am pretty familiar on setting it in Window.

    I just have these question.

    Host IP address 192.168.1.100 (This would be my static IP that I want on this machine)
    => Netmask: 255.255.255.0
    => Network ID: 192.168.1.0 (What is this?)
    => Broadcast IP: 192.168.1.255 (What is this? Never seen in Window)
    => Gateway/Router IP: 192.168.1.254 (This would my router IP)
    => DNS Server: 192.168.1.254 (I do not use DNS. Can I put my ISP DNS?)

    On PC there is a alternate DNS server also. How do I include it here?

    Thanks for helping!

  • Cliff Apr 5, 2009 @ 14:31

    Thanks for the tutorial. This is excellent reference material.

  • P.C.S.V.PRASAD Apr 20, 2009 @ 8:35

    IN WinXP i configured my network as follows
    IP : 172.16.4.15
    Sunbet : 255.255.255.0
    Gateway : 172.16.4.1
    Prf DNS : 172.16.4.1
    Alt DNS : 207.56.250.6
    But sugest me how to configure in UBUNTU Linux GUI
    I am not able to understand how it was taking Broad cast as 172.16.4.255

    Thaks

  • Gagan Apr 22, 2009 @ 7:43

    Thanks.. quick fix!

  • arasu May 20, 2009 @ 19:40

    excellent but i cannot save the terminal after changes. anyone can help me

  • Matey May 28, 2009 @ 12:06

    Hello All:
    How do I change my MAC (HW) Address in Ubuntu? (for eth0)
    I know I can use ifconfig but the help files is full of these [[[ <>>]]] and m ore brackets and its too confusing, why couldnt they show the real command instead of all these brackets?
    Any way my connection is OK but I get refused!? (so wots new) lol 😉
    I cant get on the web.so i think my MAC address has been put on the black list of some sort.!?

    Thank You!

  • tutu Jun 18, 2009 @ 15:54

    there’s no etc/network on my RedHat 7.0 Linux. Where should I go from here? I was able to change the IP with the ifconfig but I would like to make it permanent. Thanks.

  • tutu Jun 18, 2009 @ 20:01

    Thank you, I got it.

  • Mehdy Mahmood Jul 4, 2009 @ 20:03

    I have pppoe connection , i need to connect my pc to my local lan , so i have set up ip to my lan card . but we ever i set up the ip to my lan ,, my pppoe goes down , but lan works . so my lan and my pppoe works dont work together. please help me out . i need to work them together.

  • Amit Patel Jul 11, 2009 @ 6:12

    above blog was extremely helpful for me.

    thanking you a lot !!

  • delzio marcos Sep 20, 2009 @ 13:25

    eu configurei a placa eth2 em meu sistema e observei que deveria deixar no final da ediçao do /etc/network/interfaces uma linha com auto eth2.pra que serve esse comando auto eth2
    Excelente dica voce deicou para nós pobres mortais acostumados (mal) com o Windows xp.Eu não estava acertando a configuração da placa de jeito nenhum , mas agora está funcionando as mil maravilhas, muito grato pela dica.
    P.S. Eu não sabia onde colocar os dns do meu servidor o primario e o secundario, acho que só faltava para mim essa informação.

    Delzio

  • delzio marcos Sep 20, 2009 @ 13:35

    Sorry but my informations are writed in portuguese, Iam trying to write in english.
    I had configured my card eth2 in my system and I observed that I had to mantain in the last line the command auto eth2. Please whato do this command auto eth2.
    Excelent information you gave to us poor mortals now the card aquired the new static IP
    and works very well.
    P.S. I did not know where I must insert the two DNS from my provider (the primary and the secondary) I guess the only error I made was do not edit the resolv.conf. and know with the excelent information you gave us it was possible to have all right.
    sorry for my bad english.

    Delzio

    • 🐧 nixCraft Sep 20, 2009 @ 16:45

      edit /etc/resolv.conf and add nameserver as follows:
      nameserver 192.168.1.254
      nameserver 4.2.2.1
      nameserver 4.2.2.2

  • Marcio Carneiro Oct 28, 2009 @ 19:35

    And for wlan?
    Can you write the files for a wireless lan?

  • Sukesh Nambiar Nov 3, 2009 @ 6:48

    Great job. Very handy when trying to troubleshoot network issues. Thanks a lot.

  • sumanta mishra Jan 18, 2010 @ 6:56

    how to change password of server

  • Bebino Quines Jan 19, 2010 @ 3:07

    Thanks a lot, big help for me..

  • Rahul Jawale Mar 11, 2010 @ 5:01

    Thanks a lot and kudos to the cheat-sheet. That helped me to setup my Home Server. 🙂

  • mdkhan Mar 29, 2010 @ 10:31

    how to configure eth0 and eth0:1 in ubuntu

    allready in my system it has been created by others
    in terminal
    ifconfig eth0
    inet address 192.168.0.104
    broadcast 192.168.0.255
    netmask 255.255.255.0

    in eth0:1

    192.168.2.1
    broadcast 192.168.2.255
    netmask 255.255.255.0

    plz explain me how to assign the interfaces

    • MA Khan May 30, 2010 @ 4:31

      This is for second ip
      @@@@@@@@@@@@@@@@@
      sudo vi /etc/network/interfaces

      auto eth0:1
      iface eth0:1 inet static
      address 192.168.2.10
      netmask 255.255.255.0
      gateway 192.168.2.1
      After entering all the details you need to restart networking services using the following command
      sudo /etc/init.d/networking restart

  • Srinivas Apr 16, 2010 @ 11:54

    Hi, I tried to change Static IP address in ubuntu8.4, as follows
    iface eth0 inet static
    address 192.168.12.12
    netmask 255.255.255.0
    network 192.168.1.10
    After changing from DHCP to Static i am not getting internet too. Can you help me where I am missing? My Ubuntu is running under windows platform, by using VMWare.

    • Garrypb May 16, 2010 @ 8:44

      You left out the gateway. It sounds like you wanted the Ubuntu VM online, if so, the gateway would be the ip of your router (ADSL modem or similar) that connects you to the internet.
      gateway 192.168.12.1 (or ip of router)
      & you have a strange network address, It looks like it should be:
      network 192.168.12.0

  • Otto Apr 24, 2010 @ 10:08

    What else should be made for a wireless connection?
    The end of my interfaces file has:
    wpa-driver wext
    wpa-conf /etc/wpa_supplicant.conf

  • RPS Jun 7, 2010 @ 12:25

    Hi,
    I am able to change the IP address from DHCP to static using commands. But when I restart the machine, I do get only DHCP IP address. It seems chaging from dhcp to static is not being saved in config file. Is there any command to save the settings which I have done to change the IP? I got in some posts that “To make permanent changes to IP address you need to edit configuration file according to your Linux distribution.” but I dont want to go for that .. Is there any command to execute to save the changes ???
    Thanks ..

    -RPS

    • ritz Sep 6, 2011 @ 15:35

      restart the service by running the command

      sudo /etc /init.d /networking retart

  • Suhas Jun 25, 2010 @ 20:28

    Thank you

    • arsene Jul 2, 2010 @ 5:55

      I have written a python script that helps configure network.
      It can be downloaded at Link

  • Deepak Yadav Jul 14, 2010 @ 8:16

    Thank you buddy

    If you have any imp commands then mail me
    i am support exe. of ubuntu

  • Top News Aug 23, 2010 @ 11:11

    Thanks a ton. it solved my issue

  • alex Sep 8, 2010 @ 5:32

    Hi, I did the above, and now when I try to update or install anything onto the server, it fails to fetch or do anything. It does still allow workstations access to the samba files.

    i edited both the “interface” file and the resolv.config as the kind man above instructed.

    any help to determine why internet access is not working?

    my resolv.conf file reads (is this right?)
    192.168.1.254

  • igor Oct 22, 2010 @ 9:01

    use

    sudo apt-get install resolvconf, and edit /etc/resolvconf/* settings

  • Name * Oct 28, 2010 @ 18:28

    thnx..

  • Peter Draganov Nov 18, 2010 @ 19:20

    Will you add to this howto the need to add following line to /etc/network/interfaces as suggested by 2 people back in 2007 and 2009?

    auto eth0

  • me Feb 11, 2011 @ 19:13

    tnx..

  • sachin Sep 14, 2012 @ 13:13

    in my pc there is no dhcp … there is something like this ..

    iface lo inet loopback

    so now wat i have to do to change my IP?

  • Coldnorth Feb 5, 2013 @ 16:42

    Excellent guide, thanks for putting it together. I was having trouble keeping my IP’s static and had to use WICD to set them after every reboot. 5 minutes after reading this everything works perfectly.

  • adhitya christiawan nurprasetyo Apr 22, 2013 @ 3:53

    dont forget to add this line below to automatically fire up the device.
    auto eth0

  • udin May 17, 2013 @ 15:56

    Thank you… Your tutorial very useful anytime.. 🙂
    Keep posting..

  • abhishek Oct 10, 2013 @ 16:57

    I want to setup dhcp and static IP I have 2 lan card, Ubuntu 12.04 and it is a laptop the wireless interface I want to give a static IP and lan to have a dynamic ip how should I go about making changes in /etc/network/interfaces file
    the wlan0 is wireless interface and eth0 is lan card that is what ifconfig reports

    till now I tried

    auto lo
    iface lo inet static
    address 192.168.1.7
    netmask 255.255.255.0
    gateway 192.168.1.1
    network 192.168.1.0
    broadcast 192.168.1.255
    dns-nameservers 127.0.0.1
    dns-search home.lan
    dns-domain home.lan
    and
    auto lo
    iface lo inet loopback

    auto wlan0
    iface wlan0 inet static
    address 192.168.1.7
    netmask 255.255.255.0
    gateway 192.168.1.1
    network 192.168.1.0
    broadcast 192.168.1.255
    dns-nameservers 127.0.0.1
    dns-search home.lan
    dns-domain home.lan

    these both seem to have broken one or the other service.

  • abhishek Oct 10, 2013 @ 20:49

    Can you suggest a similar method for wireless interface on ubuntu I want to set static ip on ubuntu I want to setup static ip on my wireless interface

    I followed a guide here

    
    /etc/network/interfaces files has following entries
    
    auto lo
    iface lo inet loopback
     auto lo
       iface lo inet loopback
    
    auto wlan0
    iface wlan0 inet static
          address 192.168.1.7
          netmask 255.255.255.0
          broadcast 192.168.1.255
          gateway 192.168.1.1
          wpa-ssid bsnl2
          wpa-psk  e61b988cf433a0275de2a0ea569417479adb1b49698f432152cc1c5a901369ce
    

    but upon reboot I am totally disconnected from my wireless network ,
    do I need to do some thing else for giving the wireless interface a static ip

  • nava Oct 21, 2014 @ 4:25

    suppose i have two virtual network eth0 and eth0:1 as shown below

    iface eth0 inet dhcp

    auto eth0:1
    iface eth0:1 inet static
    address *.*.*.*
    netmask *.*.*.*
    gateway *.*.*.*

    can i set priority between two interfaces? If yes how?
    the PC should always go for eth0 when connected to network and eth0:1 if connected to cross over cable.

    • intosomethin Dec 28, 2014 @ 12:05

      @nava: “eth0:1” seems to be more like a bridged interface than a separate NIC. If you didn’t just make it up as an example. So 2 Interfaces demand two NIC’s (Network Interface Card) – either a physical or a virtual one. Why would you use a Cross-Overcable in the first place?
      Install SSH and Download a small software piece called “PuTTy” on your Winclient and you can just copy the stuff via scp or sftp. Here a quick guide:
      # Installing SSH
      $ sudo apt-get install ssh
      $ sudo service ssh restart # just in case, it didn’t start
      $ sudo netstat -tlpn # this should show whether ssh is listening on Port 22 (the line should be there)
      then simply transfer data by:
      $ ssh @
      The first time you do this, you gotta confirm and type “yes” once asked for it.
      Then you can browse remotely with cd, ls, pwd and locally with the same commands just with an “l” for “local” in front of them: lcd, lls, lpwd. “get” and “put” downloads and uploads stuff from/to the current local and remote directories you are in. Quite the ssesion with “exit” or CTRL+D …hope that helps.

    • intosomethin Dec 28, 2014 @ 12:09

      the ssh@ line got caught by the html, it should be:

      $ ssh username@remotehostname # (or better Ip)

    • intosomethin Dec 28, 2014 @ 12:13

      PLEASE IGNORE OR DELETE comments 81 & 82
      @nava: “eth0:1″ seems to be more like a bridged interface than a separate NIC. If you didn’t just make it up as an example. So 2 Interfaces demand two NIC’s (Network Interface Card) – either a physical or a virtual one. Why would you use a Cross-Overcable in the first place?
      Install SSH and Download a small software piece called “PuTTy” on your Winclient and you can just copy the stuff via scp or sftp. Here a quick guide:
      # Installing SSH
      $ sudo apt-get install ssh
      $ sudo service ssh restart # just in case, it didn’t start
      $ sudo netstat -tlpn # this should show whether ssh is listening on Port 22 (the line should be there)
      then simply transfer data by:
      $ sftp username@remotehostname # (or better Ip)
      The first time you do this, you gotta confirm and type “yes” once asked for it.
      Then you can browse remotely with cd, ls, pwd and locally with the same commands just with an “l” for “local” in front of them: lcd, lls, lpwd. “get” and “put” downloads and uploads stuff from/to the current local and remote directories you are in. Quite the ssesion with “exit” or CTRL+D …hope that helps.

  • intosomethin Dec 28, 2014 @ 11:50

    In order to save beginners from using Vi(m) or Nano, I’d recommend to append the DHCP settings via “echo”:

    $ sudo echo “auto eth0niface eth0 inet dhcp” >> /etc/network/interfaces
    $ sudo ifdown eth0
    $sudo ifup eth0

    does the job w/o having to go into editors.

Leave a Reply

Your email address will not be published. Required fields are marked *

Use HTML <pre>...</pre>, <code>...</code> and <kbd>...</kbd> for code samples.