1
(This post is in two parts: top part is what I've tried, bottom half is what I'm actually trying to do.)
New notebook, Mint 16 (which uses NetworkManager), and I'm trying to just use wifi+DHCP to connect to the internet. That works fine. But I also do web development, run Apache, etc. and want to have numerous virtual hosts. I thought it was just a matter of adding some static IPs, but something very weird is going on.
Let's say the wifi router gives me 10.1.2.3, and I can see that under wlan0 using either ifconfig
or ip address show
. I also see eth0
without any IP addresses, and lo
with 127.0.0.1. All is fine at this point. But then I do:
ip address add 10.1.2.61/8 scope global dev eth0 label eth0:61
(I've already setup an Apache virtual host on this address.) Going to http://10.1.2.61/
appears to be working. Ping works. But what has definitely broken is the internet. E.g. when I google something there is now a long time-out before it replies. Or it doesn't reply at all. (Sorry, I've not quite narrowed down when it is one or the other.)
I've also tried with:
ip address add 10.1.2.61/8 scope global dev lo label lo:61
Again this works (ping works), and again it breaks the internet.
I've confirmed that /etc/resolv.conf is not being touched. The output of route -n
is unchanged when I use dev lo
, and when I use dev eth0
I see an eth0 entry in there, but the wlan0
entry is still in there fine.
When I remove the added IP address (ip address del 10.1.2.61 dev eth0
), the internet starts working again.
I'm not tied to this approach. I spent a good long while reading NetworkManager docs but it didn't seem to cover this scenario. Which seemed strange.
The Actual Goal
- Be able to have multiple Apache virtual hosts on this notebook, each of which I can access with a URL (whether IP address, like
http://10.1.2.61/
or a namehttp://mytestsite/
) - Have the URL be constant, so I can bookmark them. E.g.
http://mytestsite/some/site/part.html
) - Have it still work both on my local LAN (where I control the router and DHCP), and out and about (when I don't).
- When on my LAN I'd love for the test sites to be visible to other devices connecting to the same wifi router. (This is an optional requirement: this is the only bit that I am not sure is possible... I suppose if I ran all the VirtualHosts off of the wlan0 DHCP address then it works, but I don't see how to configure Apache and /etc/hosts when I don't know what DHCP address I will get in advance, and that it could change at any time as I move from network to network.)
I'm thinking the question title needs rewording somehow... but it's kind of a mouthful any way I try. – BeowulfNode42 – 2014-04-23T10:28:47.213