Typing 'ipconfig' into Command Prompt shows two IPv4 addresses. Which one is my computer? - windows-phone-8

I'm tring to test my Windows Phone 8 app on an actual device, but I need the IP Address of my computer in order to do this. When I type 'ipconfig' in the command prompt, it shows two different IPv4 addresses and I can't tell which is the correct one for my computer that will allow me to test the app on a device.
Command Prompt Output:
Ethernet Adapter vEthernet <Internal Ethernet Port Windows Phone Emulator Internal Switch>:
IPv4 Address......: 169.254.xx.xx
Ethernet Adapter vEthernet <New Virtual Switch>:
IPv4 Address......: 192.168.x.xxx
I'm having a heck of a time getting this app to actually work on a device so if there is anything you see that is off, by all means let me know. My concern in this question though, is which of these is the true IP Address of my computer?

The one starting with 169.254 you can safely ignore. If a device does not receive an IP from any DHCP server within a few seconds, it creates its own, starting with 169.254.x.x, but you can't reach anything with such an IP, nor can anything reach your device.
The second one is the real one in your case. 192.168.x.x means you are part of a private network (but it could also be 10.x.x.x).

If you see multiple IPv4 addresses listed in command prompt as a result of ipconfig command, then the IPv4 address that has Default Gateway is your main or current device or computer IPv4 address.

The first one is your computer's IP address, the second one is for application or OS virtualization.

Related

Windows Phone not accepting DCHP offer

I'm having an odd problem with my Windows Phone (Lumia 640).
I've been using a Linux server running dhcpd for my DHCP server for a while now and every device I've got in the house is happily getting their IP addresses from it (generally assigned via MAC address so that I know what is on what IP). However, my Lumia 640 was only intermittently connecting to the network, I went round the houses trying to work out what was going on, and in desperation I turned on my BT HomeHub's DHCP server and all of a sudden the phone would connect (on an IP served by the HomeHub).
My config on the DHCPD server is nothing exciting, and the IP addresses assigned are outside of the subnet so they don't clash with any dynamically assigned addresses. As I've said I have no troubles with the configuration for multiple devices (android, iOS, MacOS, Linux, Windows, SONOS), it's only the Windows Phone that has any issues.
Any ideas? Config below...
# defaults
ddns-update-style none;
option domain-name-servers 208.67.220.220, 208.67.222.222;
option subnet-mask 255.255.255.0;
option routers 192.168.44.1;
option broadcast-address 192.168.44.255;
option ntp-servers 192.168.44.254;
default-lease-time 600;
max-lease-time 7200;
# If this DHCP server is the official DHCP server for the local
# network, the authoritative directive should be uncommented.
authoritative;
# Use this to send dhcp log messages to a different log file (you also
# have to hack syslog.conf to complete the redirection).
log-facility local7;
# No service will be given on this subnet, but declaring it helps the
# DHCP server to understand the network topology.
#
#subnet 10.152.187.0 netmask 255.255.255.0 {
#}
# This is a very basic subnet declaration.
subnet 192.168.44.0 netmask 255.255.255.0 {
authoritative;
range 192.168.44.50 192.168.44.79;
}
# Lumia 640
host russphone {
hardware ethernet **MAC address here**;
fixed-address 192.168.44.3;
}
I discovered that my router (a BT HomeHub 5) was still sending out DHCP offers despite the server being turned off. Resetting it fixed the problem, not sure why the server was still running, or why certain devices were consistently affected (my phone and my networked printer) and other completely unaffected.

Localhost won't load

I had to reset my router and modem, after a 3 hour task of getting those working properly again I can connect to the internet.
I had WordPress running locally on MAMP and the IP address I'd connect to was http://192.168.1.141:8888, now I can't access this address at all locally, the page never properly loads. http://localhost:8888/MAMP/ does load, I can access phpMyAdmin, start page etc.
However localhost:8888 sort of 'half' loads? I can see the title of the site I have running locally in the browser tab and at the bottom it says 'connecting to http://192.168.1.141:8888' but it never loads properly.
Restarted MAMP, cleared browser cache, restarted computer etc, nothing fixes it.
While 192.168.1.141 is the address you used to connect to, after resetting your router and modem, depending on how your router assigns IP addresses (statically or dynamically), your IP address may have changed.
How to check your ip address on Windows:
Click start menu
type in cmd.exe
type ipconfig into the terminal
your ip address should be listed in the results
#gilsho: ifconfig is the *nix command, MAMP I think stands for Microsoft / Apache / Mysql / PHP.
Correction: #gilsho: you are right. MAMP is Mac, so you would use ifconfig.
http://en.wikipedia.org/wiki/MAMP
Once you confirm your ip address, we can continue to help you.
Edit: To make things easier for you, I would go into your router (usually 10.0.0.1 or 192.168.0.1) and set up your ip address to a static one (they usually make it easy for you; your mac address can be found in the ipconfig results, just assign the mac address to an ip address in the range it assigns you. That way, the router will always give you the same ip regardless of whether it is restarted or not.). This will not mean you can access your webpage outside of your router network though.
Edit #2:
Try using a simple index.html (maybe your apache comes with one) that you can try loading. Perhaps it is your webpage that bricks something while loading. In any case, it's best to simplify the problem. If you can load a simple html "hello world" page, then it's likely a problem with your code.
Edit #3:
Is your webpage using any additional technologies? You have PHP, Python, Ajax/jQuery, etc. etc. If one of these components or plugins is missing or not configured, you may also see problems such as loading issues, 405/500 errors, etc.
Routers typically use DHCP to hand out local IP address to host machines. I suspect that when you restarted your router your machine received a different IP address. In order to find your new IP address, run:
ifconfig
from the command line. The output should look something like this:
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
ether c9:a4:51:43:5b:1b
inet6 fe80::bae8:56ff:ae23:5c1a%en0 prefixlen 64 scopeid 0x4
inet6 2601:9:400:1185:bae8:56ff:fe43:5b1a prefixlen 64 autoconf
inet6 2601:9:400:1185:fdcd:395b:4671:7cbf prefixlen 64 autoconf temporary
inet 192.168.1.113 netmask 0xffffff00 broadcast 192.168.1.255
nd6 options=1<PERFORMNUD>
media: autoselect
status: active
search for the inet field, that's your current local IP address.
Ok well that took FOREVER to fix, but after I managed to reset my router and set all that up again I decided to use manual DHCP and just changed it back to my old local IP.
God, working with any equipment you get from an ISP is a nightmare.

Docker container without ipv4 address

Under ubuntu 13.04 with docker 0.7.2 when I create a container via Dockerfile or interactively : the network interface generated veth** does not have an ipv4 address but an ipv6 one.
How can I get a ipv4 address ? Is there some things I missed. Does this depends from my network configuration ?
Same behaviour on a 12.04 box.
The network interface veth… in the host shouldn't have an IPv4 address. Those virtual interfaces work in pairs:
One interface will be in the container, it will be named eth0, and will have an IPv4 address. For all purposes, it looks like a normal interface.
The other half of the pair is the veth… interface. It will be in the host, and won't have an IPv4 address.
Those two interfaces are connected together: any packet sent on an interface will appear as being received by the other. You can imagine that they are connected by a cross-over cable, if that helps :-)
The fact that the veth… interface has an IPv6 address is just because when IPv6 is enabled, all interfaces receive at least a link-local address. But this address is essentially useless in that case.
Restart the docker service once. This will show the ipv4 address in docker0 link
sudo systemctl restart docker.service
Please keep in mind that the running containers will be closed down.
You can check the ip by using ifconfig command

dyndns equivalent for ports? (so that port changes don't require config file changes)

DynDNS et. al. are great for not having to put IP addresses in config files... I put the dyndns domain in the config and if I ever want to change the server location I just update it in one place, and the config stays the same. But what if I want to change the port number that's used? Is there an equivalent for ports - so that I can also get what port to connect to from some service just like I get the IP from DynDNS? Or what's another solution (besides not changing the ports)?
DynDNS and DNS in general has the main purpose of not having to remember a host by its IP address. The DynDNS part comes is mostly to solve the issue of people who don't have static IP addresses, and they occasionally get new IP addresses when their DHCP leases expire.
The original intention wasn't really meant to account for someone purposely changing their IP address or port numbers. Usually a service is on a well known port that doesn't change, such has 80 for http. Depending on the protocol, you could set up a well-known port, and then have it redirect to a different port. As an example, some websites will redirect port 80 to 8080, but this is protocol dependent. This also won't work for a lot of other protocols, and you're usually stuck with the port you choose.
Using DynDNS I access three different machines behind the same router by simply adding a colon and the port number just as if I were adding it to a static IP address (ie myhome-computer.dyndns.biz:1234 ). Each port points to a different internal ip in the router. This works fine with my free host account. However, I am not aware of a port identifier that could report as the DynDNS host app does.

Performance of local domain vs localhost

Is there a performance difference between TCP connections to:
localhost / 127.0.0.1
a domain which resolves to the local machine
Or more specifically, do the latter connections go through the loopback device, or over the actual network?
The reason I'm asking is I'm thinking about changing database settings in many PHP apps so they use a full domain instead of localhost. That way we could more easily move the database to a different server, if the need arises.
This is implementation and operating system dependent. On Windows, anything connecting to a local IP address, even if it is an outside-facing IP, will go over loopback. This is a documented problem for applications such as packet sniffers, because you can't sniff the loopback. (Windows doesn't treat loopback as a "device" -- it is handled at the network level.) However, in this case it would work in your favor.
Linux, in contrast, will follow whatever you have in your routing table, so packets that are destined to your local machine will go to your local machine over the network if the routing table isn't properly configured. However, in 99% of the cases the routing will be configured properly. Your packets won't go over the loopback device, but the TCP/IP stack will know that you are contacting a local IP and it will virtually go out and back in the proper ethernet device.
In a properly configured environment, the only bottleneck for using a domain name would be DNS resolution time. Contacting an outside DNS can add additional latency into your configuration. However, if you add in the domain name into your /etc/hosts file (C:\Windows\System32\drivers\etc\hosts on Windows), your system will skip the DNS resolution phase and obtain an IP directly, making this time cost moot.
That depends on how the names are resolved. The procedure is typically /etc/hosts first and then DNS if that fails. If localhost is in your /etc/hosts, putting whatever.wherever in the file as well will make it resolve with the same speed.