My wireless router is an old Linksys BEFW11S4 (801b). I wouldn’t ask for more in terms of speed, when I’m working from the laptop the bottleneck is the upstream Internet provider (cable), and if I have to transfer massive amounts of data between the laptop and the home computer, I can connect directly into the router with a wire and get 100Mbit.
But there is something my router doesn’t have: static DHCP assignment of addresses. I hate it when I’m on the laptop and I don’t know the IP address of the home computer. I could configure the IP address on the home computer statically, but since I also have to use OpenVPN I’d have to set up dnsmasq so I can get the proper DNS server when connecting to the VPN. Or I could use NetworkManager which would take care of switching the name servers for me.
One solution I found was to have the eth0 interface on the home computer be assigned by the router via DCHP, and have a virtual interface (alias) eth0:0 configured with a static address that I can ssh into.
OK, so I’ve set up the alias in /etc/sysconfig/network-scripts/ifcfg-eth0:0 (I’m not a GUI guy when it comes to configuring the networking, I prefer to go directly on the filesystem and write the file myself – nevertheless, using system-config-network would do the same thing for you).
Except that NetworkManager will not bring the interface alias up. It will bring the main interface up, but not the alias.
After digging a bit, it turns out NetworkManagerDispatcher is at fault, and this is the solution I found:
- mkdir -p /etc/NetworkManager/dispatcher.d (on a newly installed system it was not created by default)
- Add this eth-subinterfaces file to /etc/NetworkManager/dispatcher.d:
#!/bin/bash iface="$1" shift action="$1" shift if [ "$iface" = "eth0" -a "$action" = "up" ]; then /sbin/ifup eth0:0 fi
- Make sure you chmod 0755 /etc/NetworkManager/dispatcher.d/eth-subinterfaces
- You may or may not have to restart NetworkManagerDispatcher (I think it just worked for me):
- /sbin/service NetworkManagerDispatcher restart
- Click on the NetworkManager icon, disable networking and re-enable it.
At this point, ifconfig should show the interface alias.