PDA

View Full Version : Cannot set static IP address in Knoppix 7



voidxor
01-04-2013, 10:08 AM
I often boot to Knoppix 2 (the command-line) on a network without DHCP that I administer. Up through Knoppix 6, I always set a static IP address by appending the following to /etc/network/interfaces:

auto eth0
iface eth0 inet static
address 10.0.0.200
netmask 255.255.255.0
gateway 10.0.0.1

Then, I would bring it up:

ifup eth0
portmap (I now am using "rpcbind" instead since portmap is renamed in Knoppix 7)
rpc.statd


This has always worked for me the in the past using pre-version 7 Knoppix and portmap. Now it works, but only for 15 seconds or so before the interface falls down. Both the presence of an IPv4 address in "ifconfig" and pinging reveal that. I can even bring eth0 up and "ping -c 40 10.0.0.1", then watch it ping successfully the first few times and get some "address not routable" error thereafter!

I've also tried the boot cheats "nodhcp" and "ip=10.0.0.200" to no avail. Is my procedure for static IPs out of date? Or have I encountered a bug in Knoppix 7?

Capricorny
01-05-2013, 02:35 PM
I haven't needed static IP for years, but this could look like some network-manager stuff to me. Tried to halt or setup the network manager?

voidxor
01-06-2013, 08:36 AM
Where do I find network manager? Is that a graphical program? If so, it shouldn't affect anything in text mode (Knoppix 2).

I did boot to the GUI and set the static IP address graphically and it worked, BTW. But that's not a solution to my problem because I still prefer text mode and should be able to change network adapter settings from there.

klaus2008
01-06-2013, 11:18 AM
Did you try the cheatcode 'nonetworkmanager'?

Capricorny
01-07-2013, 11:43 AM
Where do I find network manager? Is that a graphical program? If so, it shouldn't affect anything in text mode (Knoppix 2).

I did boot to the GUI and set the static IP address graphically and it worked, BTW. But that's not a solution to my problem because I still prefer text mode and should be able to change network adapter settings from there.

All system programs may be equipped with some kind of graphical front-ends, but still operate without them, so text mode is no guarantee that a service doesn't run and keep on doing things you don't want. If you search for network-manager, you will find it is a Gnome-based service, currently configured by /etc/NetworkManager/NetworkManager.conf (on my out-of-the-box 7.0.5 DVD), with this default content:


[main]
plugins=ifupdown,keyfile
[ifupdown]
managed=true
The intention, at least, is that you can tweak this to fit your needs, but if it doesn't wotk out, you can always use the cheat code klaus2008 suggests.

voidxor
01-08-2013, 08:23 AM
The nonetworkmanager cheat works perfectly. Thank you for the workaround. Are we gaining a consensus that Network Manager is unwelcome in Knoppix 2? Does anybody else feel that this is a bug?

Capricorny
01-08-2013, 04:52 PM
The nonetworkmanager cheat works perfectly. Thank you for the workaround. Are we gaining a consensus that Network Manager is unwelcome in Knoppix 2? Does anybody else feel that this is a bug?

I wouldn't call it a bug with today's ordinary uses. To me, it is rather a typical example of simplicity for most users becoming a hassle for some more technically oriented ones. I think the config files lets us give the MAC addresses of interfaces network-manager shall keep its fingers off, so it should be a rather simple configuration operation once one knows about it.

voidxor
01-08-2013, 09:47 PM
I wouldn't call it a bug with today's ordinary uses. To me, it is rather a typical example of simplicity for most users becoming a hassle for some more technically oriented ones.

Specifically, I meant that Network Manager is helpful to most users (who boot to the GUI). I only meant that it is unwelcome in Knoppix 2 (the text-mode). Since the default content of /etc/NetworkManager/NetworkManager.conf that you pasted above doesn't have an obvious spot for a static IP address, subnet mask, and default gateway, I find /etc/network/interfaces to be the obvious way to establish a static IP address in text mode. Therefore, I don't welcome Network Manager when booted to text mode. Furthermore, I believe Knoppix 7's command line should behave as close to Knoppix 6's command line as possible. New features shouldn't break beloved commands.

Capricorny
01-08-2013, 10:21 PM
Specifically, I meant that Network Manager is helpful to most users (who boot to the GUI). I only meant that it is unwelcome in Knoppix 2 (the text-mode). Since the default content of /etc/NetworkManager/NetworkManager.conf that you pasted above doesn't have an obvious spot for a static IP address, subnet mask, and default gateway, I find /etc/network/interfaces to be the obvious way to establish a static IP address in text mode. Therefore, I don't welcome Network Manager when booted to text mode. Furthermore, I believe Knoppix 7's command line should behave as close to Knoppix 6's command line as possible. New features shouldn't break beloved commands.

Yes, in your use situation, the case is pretty clear. But I can imagine that KK is rather reluctant to tie basic services to the graphical mode, which is why he has opted for a cheatcode off-switch instead. And when you have told networkmanager not to manage an interface, I would think the other configuration tools work or could relatively easily be made to do so.

I completely agree with respect to command line behavior.

voidxor
02-23-2013, 09:42 AM
Update: I have solved my static IP troubles by switching to Debian Live Rescue. It's like stepping into last decade, but the stability is second to none.

knopper
02-25-2013, 04:08 PM
Yes, in your use situation, the case is pretty clear. But I can imagine that KK is rather reluctant to tie basic services to the graphical mode, which is why he has opted for a cheatcode off-switch instead. And when you have told networkmanager not to manage an interface, I would think the other configuration tools work or could relatively easily be made to do so.

I completely agree with respect to command line behavior.


Network-Manager is a daemon that listens to interfaces statuses and selects a configuration based on wireless SSIDs or user interaction. It is not a graphical program by itself, but interacts with graphical user interfaces for control, as well as featuring a tiny commandline interface and controls over dbus, so it is quite flexible. By default, network-manager does a lot on its own, like trying DHCP as soon as you plug in a cable into the network card.

Actually, network-manager should respect manual settings in /etc/network/interfaces, also in textmode. In fact, Knoppix contains a script that changes network-managers configuration entirely via /etc/network/interfaces for use in textmode:
"knoppix-networkmanager".

However, after changing /etc/network/interfaces manually, you need to restart network-manager in order for changes to take effect:

sudo /etc/init.d/network-manager restart

Do NOT use ifup/ifdown if network-manager is running. Network-manager will ignore the lock status of ifup/ifdown, while ifup/ifdown will ignore all settings done with network-managers own control programs.

Using static IP addresses in network-manager works fine as long as there is a physical connection, but unfortunately, network-manager does not seem to keep the set IP address when there is no carrier signal on the network cable.

If you want to use the command-line, you have the option of excluding an interface from being handled by network-manager:

sudo nmcli dev disconnect iface eth0

which makes network-manager stop listening on eth0 at all, so you can work with ifup/ifdown again if you are more used to these.

Or just suspend network-manager:

sudo /etc/init.d/network-manager stop

(which is an alternative to using the "nonetworkmanager" cheatcode in Knoppix).

Because of its user-friendly desktop integration in Gnome and KDE (and LXDE, too), most distros are using network-manager by default nowadays. For commandline experts who are used to configure everything manually via ifconfig and route, it's a little uneasy that a daemon is handling all the network stuff and will override manual settings (except in the aforementioned cases), I agree with that. So I would recommend just booting Knoppix with the "nonetworkmanager" option, or use the tricks above to revert to the non-automatic configuration behaviour.

Regards
-Klaus