Announcement

Collapse
No announcement yet.

Setting IP address by command line

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Setting IP address by command line

    Is there a way to set my IP address and gateway information by command line? I'm having a problem with Knetworkmanager connecting me or even letting me manually configure my network settings. The knetwork problem seems to be somewhat of a common problem with HH from what i'm seeing on the forums.

    Thanks,

    Ghozty

    #2
    Re: Setting IP address by command line

    yes.

    you can set up networking manually from the command line.

    you need to use different commands and do different things
    depending on whether you're talking wired or wireless, though.

    and things also depend on how you're setup modem/router wise.
    if it's static ip or dhcp, for example.
    stuff like that.

    but what is it that's not working right now?
    could you describe your setup and problems?

    oh, and post the result of:
    Code:
    ifconfig -a
    to see the current if status

    Code:
    netstat -rn
    to see the routing table

    Code:
    cat /etc/network/interfaces
    to see the network if configuration file

    cheers
    gnu/linux is not windoze

    Comment


      #3
      Re: Setting IP address by command line

      Yesterday i was playing around with this and I was getting an invalid gateway error, if your getting the same problem here is the possible solution:

      1. Configure your static ip under the Network Interfaces tab including advanced settings (broadcast address example for 192.168.1.x 255.255.255.0 192.168.1.255)

      2. Go to the Routes tab and set the default gateway there as well.

      Comment


        #4
        Re: Setting IP address by command line

        Here are the results of ifconfig -a:

        eth0 Link encap:Ethernet HWaddr 00:14:22:4e:45:b4
        inet6 addr: fe80::214:22ff:fe4e:45b4/64 Scope:Link
        UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
        RX packets:600 errors:1 dropped:0 overruns:0 frame:1
        TX packets:29 errors:0 dropped:0 overruns:0 carrier:0
        collisions:0 txqueuelen:1000
        RX bytes:56541 (55.2 KB) TX bytes:5201 (5.0 KB)
        Interrupt:16

        eth0:avahi Link encap:Ethernet HWaddr 00:14:22:4e:45:b4
        inet addr:169.254.5.219 Bcast:169.254.255.255 Mask:255.255.0.0
        UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
        Interrupt:16

        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:8 errors:0 dropped:0 overruns:0 frame:0
        TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
        collisions:0 txqueuelen:0
        RX bytes:592 (592.0 B) TX bytes:592 (592.0 B)


        And Netstat -rn:

        Kernel IP routing table
        Destination Gateway Genmask Flags MSS Window irtt Iface
        169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
        0.0.0.0 0.0.0.0 0.0.0.0 U 0 0 0 eth0


        And /etc/network/interfaces:

        auto lo
        iface lo inet loopback


        All I am trying to do is set up a static IP address with a gateway and two dns servers. The problem is that knetworkmanager will start up, but won't keep a connection nor will it let me do a manual config. This is wired btw.

        Comment


          #5
          Re: Setting IP address by command line

          guess it's avahi that's causing troubles.

          i would suggest to remove avahi and see what happens.

          Code:
          sudo apt-get autoremove avahi-autoipd avahi-daemon
          it will want to remove a couple of other packages.
          including kubuntu-desktop.
          just go on and confirm.

          restart your system (it's is not really necessary, but easier).

          see if you can configure you network statically from knetworkmanager now.
          gnu/linux is not windoze

          Comment

          Working...
          X