Results 1 to 7 of 7

Thread: Setting Static IP on Kubuntu

  1. #1

    Thread Starter
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,537

    Setting Static IP on Kubuntu

    I've recently built a new PC box. I threw Kubuntu on it because I had it handy and I didn't feel like having to dig around and figure out which version of Linux I really wanted. Anyways, one of the things I want to do with it is web development. Apache is installed, PHP5, MySQL, etc... all by hand, which was cool, never done that before, had always used WAMPP for it.

    Now when I'm on that box, I can use localhost to run the web server. But I'd like to also access it from off the box, like my chromebook, for testing. which means i need to know the IP. Urgh... yeah, I know i can use ifconfig to get it, but that's a pain. I'd rather be able to assign a static IP to the box and then it jsut works.

    Which is where I run into issues. I've tried searching for how to set a static IP, I get one of two results - old articles for a net manager that doesn't exist any more, or the typical do this, then that, and then something else followed by and of course you'll need to also.... for which the "you should see this:" sample outputs don't match what I'm seeing. OR, when it does match, and I make the changes, the interwebs stop working. UGh.

    I'm running the latest Kubuntu. When I go into the connecton properties, I change the connection from DHCP to "Static" set the address, mask and the gateway... save it... and that works... for about 2 hours... then suddenly poof! the interwebs are gone again. I can't get re-conencted back out until I reset it back to DHCP and then restart the box.

    Unlike with Windows, I'm not afraid to tinker with it, as long as I have some understanding of what I'm doing. I've tried the UI, I've tried modifying the interfaces file... nothing seems to work. I've tried to look through my router to see if there is a setting in there that will let me set a static IP based on the MAC ... no joy there. I'm more reluctant to tinker with that since I work frm home and if I hoark my router, I'm up a creek. I'm not on the box at the moment, if someone has any idea what's going on, what I can try, that would be fantabuloso. I can provide more details from the box later if I need to - screen shots too.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  2. #2
    Frenzied Member tr333's Avatar
    Join Date
    Nov 2004
    Location
    /dev/st0
    Posts
    1,605

    Re: Setting Static IP on Kubuntu

    Are you using wired (eth) or wireless (wlan) interface?

    Try checking the output of ifconfig. That will tell you what your current IP address is, but won't tell you static/dhcp status. When the connection dies, can you ping/traceroute anything?

    Do you see any errors appearing in syslog or dmesg? This would likely be relating to NetworkManager (I'm assuming Kubuntu uses that as it is used in Ubuntu) or the network kernel module (driver in Windows speak).
    CSS layout comes in to the 21st century with flexbox!
    Just another Perl hacker,

  3. #3
    Frenzied Member tr333's Avatar
    Join Date
    Nov 2004
    Location
    /dev/st0
    Posts
    1,605

    Re: Setting Static IP on Kubuntu

    If it's really NetworkManager causing the problems, you can tell it to not manage any manually-defined network interfaces. Debian-based systems store the manual interface definitions in /etc/network/interfaces. Beware that this can cause problems with NetworkManager still controlling default routes, etc.

    Eg.
    Code:
    # This file describes the network interfaces available on your system
    # and how to activate them. For more information, see interfaces(5).
    
    # The loopback network interface
    auto lo
    iface lo inet loopback
    
    # The primary network interface
    auto eth0
    iface eth0 inet static
    	address 192.168.0.10
    	netmask 255.255.255.0
    	network 192.168.0.0
    	broadcast 192.168.0.255
    	gateway 192.168.0.254
    	# dns-* options are implemented by the resolvconf package, if installed
    	dns-nameservers 192.168.0.1
    	dns-search example.com # your local domain name here, if you have one
    If you can't see anything in the logs relating to NetworkManager, then I would suggest that it's probably not the culprit.
    CSS layout comes in to the 21st century with flexbox!
    Just another Perl hacker,

  4. #4
    Frenzied Member tr333's Avatar
    Join Date
    Nov 2004
    Location
    /dev/st0
    Posts
    1,605

    Re: Setting Static IP on Kubuntu

    Any Kubuntu-specific stuff here is pure speculation as I've only ever used Ubuntu and not Kubuntu.
    CSS layout comes in to the 21st century with flexbox!
    Just another Perl hacker,

  5. #5

    Thread Starter
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,537

    Re: Setting Static IP on Kubuntu

    Quote Originally Posted by tr333 View Post
    Are you using wired (eth) or wireless (wlan) interface?
    It's wired. I don't have a wireless card in the box. I've had poor experience with linux and the wirless card I've got so I didn't bother with it this time.

    Quote Originally Posted by tr333 View Post
    Try checking the output of ifconfig.
    I've checked the output of ifconfig, that's how I get what the address is. I could continue to do that, but it's a pain. I'm trying to do some development for a friend using forum software and in order to make the cookies work properly, I need to keep the address static so it doesn't get confused.

    Quote Originally Posted by tr333 View Post
    When the connection dies, can you ping/traceroute anything?
    That was the first thing I tried, can't ping a thing.

    Quote Originally Posted by tr333 View Post
    Do you see any errors appearing in syslog or dmesg? This would likely be relating to NetworkManager (I'm assuming Kubuntu uses that as it is used in Ubuntu) or the network kernel module (driver in Windows speak).
    No, no messages that I'm aware of. I see some status messages that scroll by pretty quickly during boot up, but nothing that looks like a dire warning about the network (most of the messages are daemons starting, plus I think there's something up with my nvidia driver). Admittedly I haven't checked syslog yet. I'll give that a go later.

    Quote Originally Posted by tr333 View Post
    If it's really NetworkManager causing the problems, you can tell it to not manage any manually-defined network interfaces. Debian-based systems store the manual interface definitions in /etc/network/interfaces. Beware that this can cause problems with NetworkManager still controlling default routes, etc.

    Eg.
    Code:
    # This file describes the network interfaces available on your system
    # and how to activate them. For more information, see interfaces(5).
    
    # The loopback network interface
    auto lo
    iface lo inet loopback
    
    # The primary network interface
    auto eth0
    iface eth0 inet static
    	address 192.168.0.10
    	netmask 255.255.255.0
    	network 192.168.0.0
    	broadcast 192.168.0.255
    	gateway 192.168.0.254
    	# dns-* options are implemented by the resolvconf package, if installed
    	dns-nameservers 192.168.0.1
    	dns-search example.com # your local domain name here, if you have one
    If you can't see anything in the logs relating to NetworkManager, then I would suggest that it's probably not the culprit.
    Yeah... that was the second thing I tried... I added the entry to the inerfaces file thusly:
    Code:
    # This file describes the network interfaces available on your system
    # and how to activate them. For more information, see interfaces(5).
    
    # The loopback network interface
    # auto lo
    # iface lo inet loopback
    
    # The primary network interface
    auto eth0
    iface eth0 inet static
    	address 192.168.1,110
    	netmask 255.255.255.0
    	network 192.168.1.0
    	broadcast 192.168.1.255
    	gateway 192.168.1.1
    Rebooted, to ensure the settings take place... it then spent several minutes during the bootup attempting to connect to the network. When I finally was able to log on, I couldn't get anywhere.

    Quote Originally Posted by tr333 View Post
    Any Kubuntu-specific stuff here is pure speculation as I've only ever used Ubuntu and not Kubuntu.
    Kubuntu is Ubuntu with the Plasma desktop pre-installed and a few additional packages installed and pre-configured (like having Libre Office)... it's supposed to make it easy for Windows users to make the transition. That's why I used it, not because I'm clinging to Windows, but because it came with a lot of that stuff already done for me. Although, I then spent the next 4 hours installing Chrome (it comes with firefox) and apache, mysql, Aptana Studio, VLC media player and some of the other tools and stuff I use. And with what I'be been doing lately, I'm finding myself in the bash shell more often than in the desktop. Meh.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  6. #6
    PowerPoster kfcSmitty's Avatar
    Join Date
    May 2005
    Posts
    2,248

    Re: Setting Static IP on Kubuntu

    Not sure if it is a typo or not, but you used a comma for your IP address (192.168.1,110). If you do have that typo in your config, it could explain some of the funkiness you've seen.

  7. #7

    Thread Starter
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,537

    Re: Setting Static IP on Kubuntu

    That was just a typo in the post. I was typing it from memory, so it wasn't a copy paste.

    One difference I noted that I did that tr33 didn't, was to comment out the loopback entry... I don't think that would have done it... but who knows. Maybe later when I get the chance, I'll try it again, leave the lo entry intact, add the static info (with . and not , ) and try it again.

    I'll say this, one thing I do like is that while this all stuff that can be easily screwed up... but equally easily fixed. Not like Windows where you have to go spellunking through the registry.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

Posting Permissions

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



Click Here to Expand Forum to Full Width