1

On my Win7 host machine, I have two VMs which I test network/server stuff.

On one machine I created an IP alias using the following commands from http://www.yolinux.com/TUTORIALS/LinuxTutorialNetworking.html#NETWORKALIASING (edit to fit my network):

ifconfig eth0:0 192.168.10.9 netmask 255.255.255.0 broadcast 192.168.10.255
route add -host 192.168.10.9 dev eth0

I can navigate to the address in my browser and up pops the web GUI from that machine. Excellent! I checked the router to see if the IP address was registered as a static IP or whatever to the same hostname. This where I caught a snag. The aliased address isn't on the list.

So on my other machine I manually entered a static IP to test if it was just that static IPs don't show up -- In theory they should right? To get to the Internet, you have to pass the gateway which logs clients. Well that shows up on the list.

My question is: how does the router see the aliased IP? Can I port forward to that alias? Google only shows me how to create an alias, not really how the aliasing works.

Jay Adams
  • 11
  • 3
  • Because you never stop looking, I've found out that `ifconfig` is actually obsolete and the command should be `ip addr add 192.168.1.9/24 broadcast 192.168.1.255 label eth1:0 dev eth1` with the "/24" being shorthand for the "(sub)netmask 255.255.255.0". Not sure if the `route` is still required though. – Jay Adams Jan 22 '14 at 04:03

2 Answers2

0

The router sees the aliased IP by way of the subnet. The gateway is only relevant for traffic to addresses that are not within the subnet range.

You might be confused with the router showing a list of DHCP-registered addresses. Your address, configured statically, will not be in that list. It might be in a "connected devices" list, but not DHCP.

Xavier J
  • 155
  • 4
  • I have DD-WRT flashed onto my router. When I navigate to Status>LAN and look under Active Clients, I should be able to see the aliased IP right? – Jay Adams Jan 21 '14 at 20:39
  • High-five! I don't have access to my router right now, but it's based on DD-WRT as well. I'm pretty sure that you should see it on the page you're describing. As for your other questions - which I think I missed - if the alias address lights up, you should be able to port forward to it. – Xavier J Jan 21 '14 at 21:39
  • Can you confirm that for me? In my OP when I mentioned that it's "not on the list", this is exactly the list I'm talking about. – Jay Adams Jan 22 '14 at 03:50
  • I took a look and was surprised. I have lots and lots of VMs but had very few items in the list. You know what? I think the active clients list only shows ip addresses with open connections - "active". Got it? So as a test, what you might try is to initiate some sort of transfer against your alias address, and then quickly flip over to the active clients list to take a peek. – Xavier J Jan 22 '14 at 06:13
  • I've been constantly ssh'ed into the machine via the 192.168.1.9 address which doesn't mark as "active". Took a long shot earlier and just port forwarded ssh which didn't work because I forgot to disable the other port forward. Having disabled the other forwarding, the ssh connect is good and the *.9 address shows on the list! So you were close codenoire, we need an outside connection to the aliased address for the router to show it. – Jay Adams Jan 22 '14 at 08:01
0

The router sees the aliased IP as any other. Since the IP is set manually, without DHCP, you just have to know it's there; its not until that IP traverses the gateway to the outside Internet that the router adds it to the "Active Clients" list. You would have to port forward to this address and connect from the outside for it to show.

Jay Adams
  • 11
  • 3
  • Setting `ip address add 192.168.1.9/24 **broadcast 192.168.1.255** dev eth0` doesn't notify the network. Nor does connecting to the IP internally. – Jay Adams Jan 22 '14 at 08:53
  • Looking into an alternative so that you don't have to remember the aliased IP. Send ARP response to router, setup router's routing table (issuing on local machine doesn't seem to have an effect). There must be an option to piggyback off the machines constant "Active" status! – Jay Adams Jan 23 '14 at 06:12