Now I have my new PC up and running it of-course comes with NetworkManager, which I've always avoided in the past but maybe it's improved?
My problem is that it seems inflexible and buggy; I just got into a right old mess by not making sure I had "disconnected" my LAN before making some changes (result: NM reporting that I'm connected using a configuration that no longer exists, and refusing to connect to my new one even though it said it was).
On the other hand, having a GUI interface to LAN/WLAN/VPN/etc would be nice and I'd prefer to make it work if it can be done.
So, ditch it or keep it?
On Tue, Aug 03, 2010 at 12:21:24PM +0100, Mark Rogers wrote:
So, ditch it or keep it?
I've had very few problems with it over the years, ok, wireless config several years back was still a bit hit and miss but not necessarily a fault with network manager. I currently use it on all my desktop and laptops and it works very well, you say you made some changes? what were they and what did you expect it to do?
If you manually try to change interfaces while it's set to automatically manage them then you will run into problems. If you do need a manual setup make sure you stop it first.
Adam
On 03/08/10 12:34, Adam Bower wrote:
you say you made some changes? what were they and what did you expect it to do?
I don't recall exactly, but they didn't feel like the kind of things that should be "wrong" :-)
I think I created a new profile with a static IP (the existing one was DHCP) and switched between them (to access different subnets of the office network). That worked. I then tried to edit my new profile to give me a static IP on both subnets and delete the old DHCP profile, but that's where it went wrong. I ended up connected on a profile that no longer existed and unable to change to the new profile, or something like that.
There are some definite weak areas that I can be specific about though; entering a new IP address is hard work, because you have to click into each field (tabbing doesn't seem to work properly), and clicking Add to add a second IP without first clicking out of the one you just added causes the last entry to be blanked (in this case the default gateway). Stuff like this just makes it feel "unfinished". I guess it means that the people who could fix these "paper cuts" are the kind of people who don't use NM?
What would be good would be if I could have a DHCP setup and add additional static IPs on top. Technically there's no reason not to, and from the point of view of /etc/network/interfaces I think it's simple enough too, but NM (like Windows) prevents that kind of thing (Windows can do it via a registry hack but you have to redo the hack every new IP you add so its more hassle than its worth). Can I get NM to not manage my LAN but still manage other stuff (WLAN, VPN, etc)?
On Wed, Aug 04, 2010 at 10:08:44AM +0100, Mark Rogers wrote:
you add so its more hassle than its worth). Can I get NM to not manage my LAN but still manage other stuff (WLAN, VPN, etc)?
If I want to mangle configuration manually I just tell network manager to disable networking and do whatever I need. To me it sounds like you have a reasonably complex setup although I can't necessarily see why it wouldn't work but having a dhcp *and* static setup at the same time really seems a bit... hmmn, well, odd. :)
I think if I needed extra config along with dhcp I'd get the dhcp server to set it all up rather than try to munge configurations, that can't be a very common setup!
Adam
On 04/08/10 10:44, Adam Bower wrote:
If I want to mangle configuration manually I just tell network manager to disable networking and do whatever I need.
Sounds like that's what I need. But I'm not entirely sure how all the bits fit together.
Do I just right-click on the NM icon and untick "Enable Networking", then go about my business in /etc/network/interfaces, or is there more to it than that?
To me it sounds like you have a reasonably complex setup although I can't necessarily see why it wouldn't work but having a dhcp *and* static setup at the same time really seems a bit... hmmn, well, odd. :)
In my case, it's just that it makes sense to have my "primary" IP address given to me by the office DHCP server - it means we can change settings (eg DNS, etc) globally nice and easily. But I also need to be able to configure hardware which will come in with known default IP addresses, so I will need to be able to reach, for example, 192.168.10.1, regardless of what the rest of the network looks like.
On Wed, Aug 04, 2010 at 11:00:32AM +0100, Mark Rogers wrote:
In my case, it's just that it makes sense to have my "primary" IP address given to me by the office DHCP server - it means we can change settings (eg DNS, etc) globally nice and easily. But I also need to be able to configure hardware which will come in with known default IP addresses, so I will need to be able to reach, for example, 192.168.10.1, regardless of what the rest of the network looks like.
For that situation... I would tend to just right click and "disable networking" and then run dhclient manually to regain a dhcp address and then do something like an ifconfig eth0:1 192.168.10.5 or... possibly just put another network card in the machine and tell network manager to leave it alone or assign that a static config but I presume this is on a laptop?
Adam
On 04-Aug-10 10:00:32, Mark Rogers wrote:
On 04/08/10 10:44, Adam Bower wrote:
If I want to mangle configuration manually I just tell network manager to disable networking and do whatever I need.
Sounds like that's what I need. But I'm not entirely sure how all the bits fit together.
Do I just right-click on the NM icon and untick "Enable Networking", then go about my business in /etc/network/interfaces, or is there more to it than that?
To me it sounds like you have a reasonably complex setup although I can't necessarily see why it wouldn't work but having a dhcp *and* static setup at the same time really seems a bit... hmmn, well, odd. :)
In my case, it's just that it makes sense to have my "primary" IP address given to me by the office DHCP server - it means we can change settings (eg DNS, etc) globally nice and easily. But I also need to be able to configure hardware which will come in with known default IP addresses, so I will need to be able to reach, for example, 192.168.10.1, regardless of what the rest of the network looks like.
Coming in late on this (and also no expert on all details of network configuration [conflagration?] ... ).
I recall, in the past, having done this sort of setup, but in a way which depends on configuring the DHCP server to *not* hand out IP addresses in a certain range. Addresses in this range can then be used as fixed IP addresses for machines that want them (these having already been configured to use fixed IP and not request dynamic IP from the DHCP server).
So you might exclude 192.168.10.1-50, say, and allow dynamic IPs above this range.
Doing this depends on configuring the DHCP server, so how to do it depends on what is involved in that. Once done, however, for any other machine it is then simply a matter of either configuring it to use a set fixed IP address, or configuring it to request a dynamic one -- and of course from time to time you can switch between these options if need dictates.
Hoping this helps! Ted.
-------------------------------------------------------------------- E-Mail: (Ted Harding) Ted.Harding@manchester.ac.uk Fax-to-email: +44 (0)870 094 0861 Date: 04-Aug-10 Time: 11:43:45 ------------------------------ XFMail ------------------------------
On 04/08/2010 11:44, (Ted Harding) wrote:
On 04/08/10 10:44, Adam Bower wrote: In my case, it's just that it makes sense to have my "primary" IP address given to me by the office DHCP server - it means we can change settings (eg DNS, etc) globally nice and easily. But I also need to be able to configure hardware which will come in with known default IP addresses, so I will need to be able to reach, for example, 192.168.10.1, regardless of what the rest of the network looks like.
Coming in late on this (and also no expert on all details of network configuration [conflagration?] ... ).
I recall, in the past, having done this sort of setup, but in a way which depends on configuring the DHCP server to *not* hand out IP addresses in a certain range. Addresses in this range can then be used as fixed IP addresses for machines that want them (these having already been configured to use fixed IP and not request dynamic IP from the DHCP server).
So you might exclude 192.168.10.1-50, say, and allow dynamic IPs above this range.
Doing this depends on configuring the DHCP server, so how to do it depends on what is involved in that. Once done, however, for any other machine it is then simply a matter of either configuring it to use a set fixed IP address, or configuring it to request a dynamic one -- and of course from time to time you can switch between these options if need dictates.
Another option - assuming you have control of the DHCP server - is to tell it to assign permanent or indefinite leases to particular MAC addresses. This is what I do at home to ensure that my laptop (and several other devices) always have the same address whenever they connect to WiFi, even though they still use DHCP to get their addresses. Result: [effectively] static addresses managed by DHCP, and no furtling around with individual ipconfigs, etc, required.
Simon
On 04/08/10 11:44, (Ted Harding) wrote:
I recall, in the past, having done this sort of setup, but in a way which depends on configuring the DHCP server to *not* hand out IP addresses in a certain range. Addresses in this range can then be used as fixed IP addresses for machines that want them (these having already been configured to use fixed IP and not request dynamic IP from the DHCP server).
To an extent this is what I'm doing, although with static leases on the DHCP server to keep addresses static rather than hard coding them.
To give a specific example: My desktop was 10.0.0.117 (static DHCP lease), however we're moving to a 192.168.250.x subnet, so the DHCP server has been updated with the new settings and my PC has automatically got its new IP address (192.168.250.117) which will "never" change. All the DNS settings were updated automatically too, via DHCP. For this reason, DHCP has its uses even when you don't want your IP to change.
However, it also had a host of other IP addresses for talking to other kit that has nothing to do with the office network. For example, my company works in stadium lighting control, communicating via TCP/IP modules which tend to be shipped (new) with a known default IP address and a web interface to change their settings. Being able to give my PC a static IP on the same subnet means when I have to configure one of these devices, I don't have to reconfigure my IP address.
The PC I am configuring is the new PC I built recently (not a laptop, to answer Adam's question, although the same issues apply on a laptop), so it's a fresh install and I'm trying to get things "right", replacing my old PC which had Ubuntu 5.10 upgraded version by version over the past few years and was still working probably more by luck than judgement (it was only replaced because I really needed more RAM and a bigger hard disk, and there comes a point where it's better to invest the money in a new PC than upgrades). The old PC was static IP only and had about 12 of them, about 7-8 of which I'd want to retain for accessing various bits of hardware that come with different default IP addresses.
Increasingly I also need access to PPTP VPN's (to client sites) and it would make my life a lot easier if I could use NM to manage those, even if I take control of eth0 away from it.
On 04 Aug 11:00, Mark Rogers wrote:
On 04/08/10 10:44, Adam Bower wrote:
If I want to mangle configuration manually I just tell network manager to disable networking and do whatever I need.
Sounds like that's what I need. But I'm not entirely sure how all the bits fit together.
Do I just right-click on the NM icon and untick "Enable Networking", then go about my business in /etc/network/interfaces, or is there more to it than that?
To me it sounds like you have a reasonably complex setup although I can't necessarily see why it wouldn't work but having a dhcp *and* static setup at the same time really seems a bit... hmmn, well, odd. :)
In my case, it's just that it makes sense to have my "primary" IP address given to me by the office DHCP server - it means we can change settings (eg DNS, etc) globally nice and easily. But I also need to be able to configure hardware which will come in with known default IP addresses, so I will need to be able to reach, for example, 192.168.10.1, regardless of what the rest of the network looks like.
OK - so network manager, believe it or not, actually fires off the scripts in /etc/network/if-up.d and /etc/network/if-down.d (and the other associated directories in there), so if you check the data that you get in those scripts, match the interface, do a cursory check in the up.d script that it's on $particular_network and then run some ip addr add commands in that script, bob's you're uncle, you're still using network manager, and it's all predictable.
HTH HAND.
On 04/08/10 12:08, Brett Parker wrote:
OK - so network manager, believe it or not, actually fires off the scripts in /etc/network/if-up.d and /etc/network/if-down.d (and the other associated directories in there), so if you check the data that you get in those scripts, match the interface, do a cursory check in the up.d script that it's on $particular_network and then run some ip addr add commands in that script, bob's you're uncle, you're still using network manager, and it's all predictable.
OK, I've been saving this until I have time to try this, but I'm a bit out of my depth...
I've never had to play with the up/down scripts before, but if I get the gist of what you're saying I need to create a new script, say /etc/network/if-up.d/extra-ips, which: (a) checks whether the interface is my LAN card (which appears to be $IFACE, although I don't know what the actual value would be nor can I see how to find out?), then (b) adds the additional IP addresses to that interface, using (I assume) the right combination of parameters to ifconfig.
Does that sound right?
On 05/08/10 17:33, Mark Rogers wrote:
OK, I've been saving this until I have time to try this, but I'm a bit out of my depth...
Nothing like a bit of trial and error....
This seems to work as a script (well it did when I remembered to chmod +x it!)
#!/bin/sh set -e if [ "$IFACE" = eth0 ] ; then sudo ifconfig $IFACE add 192.168.20.117 netmask 255.255.255.0 fi
On 05 Aug 17:49, Mark Rogers wrote:
On 05/08/10 17:33, Mark Rogers wrote:
OK, I've been saving this until I have time to try this, but I'm a bit out of my depth...
Nothing like a bit of trial and error....
This seems to work as a script (well it did when I remembered to chmod +x it!)
#!/bin/sh set -e if [ "$IFACE" = eth0 ] ; then sudo ifconfig $IFACE add 192.168.20.117 netmask 255.255.255.0 fi
That looks OK to me, though, I would have used the ip command instead, and I wouldn't have bothered with the sudo (those scripts are run as root).
So, my version of the script would have been:
#!/bin/sh
set -e
if [ "$IFACE" = "eth0" ]; then ip addr add 192.168.20.117/24 dev $IFACE fi
But otherwise, all good.
Cheers,
On 06/08/10 11:29, Brett Parker wrote:
That looks OK to me, though, I would have used the ip command instead, and I wouldn't have bothered with the sudo (those scripts are run as root).
Good points. (I knew sudo wasn't needed, I hadn't spotted that I had copy+pasted it from my tests at the commandline.)
Thanks for the pointers, I feel a little bit cleverer today than I was a couple of days ago, which can't be bad :-)
On 06/08/10 11:29, Brett Parker wrote:
#!/bin/sh set -e
if [ "$IFACE" = "eth0" ]; then ip addr add 192.168.20.117/24 dev $IFACE fi
Just discovered that this doesn't seem to work correctly; I need ip addr add 192.168.20.117/24 dev $IFACE label $IFACE:0 In contrast, ifconfig $IFACE add 192.168.20.117 netmast 255.255.255.0 works (it creates its own label), but ifconfig $IFACE add 192.168.20.117/24 doesn't.
Odd!