static IP Debian 5

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • philly
    Top Poster
    • Nov 2008
    • 119

    #1

    static IP Debian 5

    Hi all,
    I am wondering if anyone can help me with setting my IP to static on my debian PC. With putty and using the command nano /etc/network/ interfaces I can see and change the DHCP entry to Static. However after I reboot I cannot now access the internet.
    Is this a DNS issue and if so where do I set this up.
    Thanks in advance,
  • zOOge
    Newbie
    • Jul 2012
    • 2

    #2
    Originally posted by philly
    Hi all,
    I am wondering if anyone can help me with setting my IP to static on my debian PC. With putty and using the command nano /etc/network/ interfaces I can see and change the DHCP entry to Static. However after I reboot I cannot now access the internet.
    Is this a DNS issue and if so where do I set this up.
    Thanks in advance,
    Example:
    frd@cardserv:/etc/network$ cat interfaces
    auto lo
    iface lo inet loopback

    iface eth0 inet static
    address 192.168.1.99
    netmask 255.255.255.0
    gateway 192.168.1.254

    Comment

    • philly
      Top Poster
      • Nov 2008
      • 119

      #3
      Originally posted by zOOge
      Example:
      frd@cardserv:/etc/network$ cat interfaces
      auto lo
      iface lo inet loopback

      iface eth0 inet static
      address 192.168.1.99
      netmask 255.255.255.0
      gateway 192.168.1.254
      Thanks for your reply.
      At the moment when I run this command 'nano /etc/network/interfaces' I get the following,

      # The primary network interface
      auto eth0
      iface eth0 inet dhcp
      address 192.168.1.127
      netmask 255.255.255.0
      broadcast 192.168.1.255
      gateway 192.168.1.1

      I then change the dhcp to static and save and reboot. After doing this I cannot get on to the internet. I also noticed that at the moment my server is working in dhcp mode with Ip 192.168.1.101 however I am still getting the above which is 192.168.1.127 which is not the case.
      Confused

      Comment

      • digicon
        V.I.P. Member
        • Jul 2009
        • 8261

        #4
        I tried this when i ran debian 6 and it never worked, i did read that it can cause issues so i went with the advice od setting the static ip in the router itself. Just a Thought

        Comment

        • mtv1
          The Stig PT
          • Apr 2008
          • 4413

          #5
          change the auto to lo

          but tbh all routers (well most)

          you can make the client static so no need to do it in debian config

          network local lan clientlist in mine you can reserve the ip


          >>>>>>>>>>Dreambox Tools<<<<<<<<<<

          Comment

          • wilf
            V.I.P. Member
            • Jan 2009
            • 1618

            #6
            spent hours looking into this myself, dont waste your time do as the others do. use router!

            Comment

            • philly
              Top Poster
              • Nov 2008
              • 119

              #7
              static IP

              [quote=digicon;1830416]I tried this when i ran debian 6 and it never worked, i did read that it can cause issues so i went with the advice od setting the static ip in the router itself. Just a Thought[/quo
              Thanks guys for your reply's.
              I use a lynksys WAG 120N router which I understand does not have the option for locking an IP to a mac address. However I can specify a starting IP and the number of addresses to issue. Maybe this will sort things out for me.

              Thanks all.

              Comment

              • philly
                Top Poster
                • Nov 2008
                • 119

                #8
                Originally posted by digicon
                I tried this when i ran debian 6 and it never worked, i did read that it can cause issues so i went with the advice od setting the static ip in the router itself. Just a Thought
                Thanks digicon,
                My router is a Lynksys and this does not support dhcp reservation so I am snookered. I need to lock the IP on the PC. To clarify if I browse to etc/network/interfaces and see my IP settings etc. I change the dhcp to static, save and reboot. I can then ping the PC but cannot access the internet.
                Thanks in advance.

                Comment

                • digicon
                  V.I.P. Member
                  • Jul 2009
                  • 8261

                  #9
                  Hi Philly,

                  As i say i tried on mine and it created problems so mine is done through the Router, Not sure if you can do it on yours but i would have thought 99% of routers allow an IP allocation.

                  You could try the Wiki guide to set the static IP:

                  NetworkConfiguration - Debian Wiki

                  Comment

                  • philly
                    Top Poster
                    • Nov 2008
                    • 119

                    #10
                    Originally posted by digicon
                    Hi Philly,

                    As i say i tried on mine and it created problems so mine is done through the Router, Not sure if you can do it on yours but i would have thought 99% of routers allow an IP allocation.

                    You could try the Wiki guide to set the static IP:

                    NetworkConfiguration - Debian Wiki
                    Thanks digicon,
                    I checked out the Wiki guide before. My settings are the same but for some reason when I set to static my internet is lost. Would this have something to do with DNS. Apparently the Lynksys wag120N although a very reliable unit does not support IP allocation.
                    Just in case it makes a difference Network Manager is installed on my system.
                    Last edited by philly; 11 January, 2013, 22:48.

                    Comment

                    • GastonJ
                      V.I.P. Member
                      • Dec 2009
                      • 5505

                      #11
                      What's the results of:

                      ifconfig
                      netstat -rn
                      cat /etc/resolv.conf
                      My master plan is to live forever..... going to plan so far
                      Despite the cost of living, it's still very popular.
                      No good deed goes unpunished....

                      Comment

                      • philly
                        Top Poster
                        • Nov 2008
                        • 119

                        #12
                        Originally posted by GastonJ
                        What's the results of:

                        ifconfig
                        netstat -rn
                        cat /etc/resolv.conf
                        Hi GastonJ,
                        Here are the net details etc.

                        eth0 Link encap:Ethernet HWaddr 00:0d:61:82:be:e0
                        inet addr:192.168.1.101 Bcast:192.168.1.255 Mask:255.255.255.0
                        inet6 addr: fe80::20d:61ff:fe82:bee0/64 Scope:Link
                        UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
                        RX packets:287756 errors:0 dropped:0 overruns:0 frame:0
                        TX packets:226312 errors:0 dropped:0 overruns:0 carrier:0
                        collisions:0 txqueuelen:1000
                        RX bytes:22771698 (22.7 MB) TX bytes:24591878 (24.5 MB)
                        Interrupt:19 Base address:0xe000

                        lo Link encap:Local Loopback
                        inet addr:127.0.0.1 Mask:255.0.0.0
                        inet6 addr: ::1/128 Scope:Host
                        UP LOOPBACK RUNNING MTU:16436 Metric:1
                        RX packets:0 errors:0 dropped:0 overruns:0 frame:0
                        TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
                        collisions:0 txqueuelen:0
                        RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
                        ################################################## #####################################

                        Kernel IP routing table
                        Destination Gateway Genmask Flags MSS Window irtt Iface
                        0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 eth0
                        192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
                        ################################################## #########################################

                        nameserver 208.67.222.222
                        nameserver 208.67.220.220
                        nameserver 89.19.64.36

                        Comment

                        • binamee
                          Newbie
                          • Jan 2011
                          • 1

                          #13
                          This should do

                          $ nano /etc/network/interfaces


                          auto eth0
                          iface eth0 inet static
                          address 192.168.1.221
                          netmask 255.255.255.0
                          gateway 192.168.1.254
                          dns-nameservers 192.168.1.254

                          Comment

                          • philly
                            Top Poster
                            • Nov 2008
                            • 119

                            #14
                            Originally posted by binamee
                            This should do

                            $ nano /etc/network/interfaces


                            auto eth0
                            iface eth0 inet static
                            address 192.168.1.221
                            netmask 255.255.255.0
                            gateway 192.168.1.254
                            dns-nameservers 192.168.1.254
                            Thanks binamee,
                            I will try your suggestion. I had it as above but I did not have any detail for the DNS.
                            Will let you know how it goes.

                            Comment

                            • fail2ban
                              Top Poster
                              • Sep 2008
                              • 101

                              #15
                              Originally posted by philly
                              Thanks binamee,
                              I will try your suggestion. I had it as above but I did not have any detail for the DNS.
                              Will let you know how it goes.
                              Actually, above you had

                              iface eth0 inet dhcp

                              Which in itself says to networking to ignore lines after it and do dhcp instead of static IP.

                              Comment

                              Working...