I needed to find the IP address for the local machine on of the webservices. In C#, I have  ManagementObjectSearcher objC = new ManagementObjectSearcher("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = 'TRUE'"); ManagementObjectCollection objCollection = objC.Get();   How could I do it in C++ Linux?
124160
This Question is almost the same as the previously asked -Question. However I need to find the IP address(es) of a Linux Machine.  So: How do I - programmatically in C++ - detect the IP addresses of the linux server my application is running on. The servers will have at least two IP addresses and I need a specific one (the one in a given network (the public one)).  I'm sure there is a simple function to do that - but where?    To make things a bit clearer:   The server will obviously have the "localhost": 127.0.0.1 The server will have an internal (management) IP address: 172.16.x.x The server will have an external (public) IP address: 80.190.x.x   I need to find the external IP address to bind my application to it. Obviously I can also bind to INADDR_ANY (and actually that's what I do at the moment). I would prefer to detect the public address, though.
50216
Does any one know how do I get the current open windows or process of a local machine using Java?    What I'm trying to do is: list the current open task, windows or process open, like in  Windows Taskmanager, but using a multi-platform approach - using only Java if it's possible.
118438
I am developing a wizard for a machine that is to be used as a backup of other machines.  When it replaces an existing machine, it needs to set its IP address, DNS, WINS, and host name to match the machine being replaced.  Is there a library in .net (C#) which allows me to do this programatically?  There are multiple NICs, each which need to be set individually.  EDIT  Thank you  for your example.  It got me moving on the right track and the quick reply was awesome.  Thanks .  Your code is perfect.  I was in a rush and had already adapted the example TimothyP linked to, but I would have loved to have had your code sooner.  I've also developed a routine using similar techniques for changing the computer name.  I'll post it in the future so subscribe to this questions  if you want to be informed of the update.  I may get it up later today or on Monday after a bit of cleanup.
98594
Having a hard time wrapping my head around IPv6 here.  A lot of the lingo seems targeted at enterprise-level IPv6 deployments, discussing link-local, site-local, global unicast, scopes, etc.  Not a lot of solid information on really small networks, like home networks.  I want to check my thinking and make sure I am getting the correct translations from IPv4-speak to IPv6-speak.  The first question is, what's the equivalent of RFC1918 for IPv6?  Initial searches suggested there was no equivalent.  Then I stumbled upon Unique Local Addresses (RFC4193), and that states that all ULA's should be assigned the prefix fc00, followed by a 40-bit random number in the routing prefix.  This random number is to "prevent collisions when two IPv6 networks are interconnected" -- again, another reference to an enterprise-level function.  If I have a small local LAN at home, numbered using 192.168.4.0/24, what's my equivalent in IPv6's ULA scope?  Assuming I will never, ever, tie that IPv6 address into the real internet (a router will NAT &amp; firewall it), can I ignore the RFC to an extent and go with fc00::4:0/120?  It also seems that any address in fc00::/7 are to be globally routable.  Does this mean I'll need extra protections so my router would not automatically start advertising these private IPv6 addresses to the world?  Second question, what's this link-local thing?  Reading suggests a default-assigned address in the fe80::/10 range that has the last 64bits of the address comprised of the interface's MAC address.  Seems to be required, too, but I'm annoyed by the constant discussion of it in relation to enterprise networks.  Third question, what is scope id for?  Seems to be yet another term tossed around in relation to enterprise networks, especially when interconnecting them, but almost no explanation on the smaller home network level.  Can I see a scope ID AND CIDR notation used together?  I.e., fc00::4:0/120%6, or are scope IDs only supposed to be applied to a single /128 IPv6 address?
114014
How can I get the BSSID / MAC (Media Access Control) address of the wireless access point my system is connected to using C#?  Note that I'm interested in the BSSID of the WAP. This is different from the MAC address of the networking portion of the WAP.
75326
I am on DHCP, having dynamic IP.  Finding your public IP when using a GUI and a browser is extremely easy. Simply go to Google.com and search for "What is my IP". Google will display it in the very first line.  However I am unable to find my public IP when inside Ubuntu server.  I have created a system with Ubuntu server (LAMP Stack) for my personal use. This system boots up simply in terminal mode. I want to do SSH using some other system across the internet; thus knowing the public IP becomes necessary.  What is the command to display the current public IP adress of that system?
19275
In my work there is a lot of computer and I want make a joke. I can close computer over the network but finding IP addresses is hard to me.  How can I easily find all online IP adresses from 192.168.1.aa to 192.168.1.zz?
15043
When I implement an RMI server (implement an interface that extends java.rmi.Remote) is there a way to get information about the current RMI request context, specifically the remote client's IP address?  public void myMethod() throws RemoteException {      log.info("remote IP is "+ RMISomething.getSomething());  }
120596
I created a new VM, and was able to ping it using its IP address.  However, I can't ping it by name - even though it belongs to the same "WORKGROUP" as my other windows machines.  What makes this particularly strange is the result of the following command:  C:\&gt;ping -a 192.168.0.20  Pinging WIN-AOHA8MSD3D0 [192.168.0.20] with 32 bytes of data: Reply from 192.168.0.20: bytes=32 time&lt;1ms TTL=128 ...   So the machine name can be queried, as indicated above, but when I turn around with that name it fails:  C:\&gt;ping WIN-AOHA8MSD3D0 Ping request could not find host WIN-AOHA8MSD3D0. Please check the name and try again.   In case it is relevant, the VM is in VMWare Workstation 7.1 using a bridged network adapter.  The guest OS is Windows 2008 R2 SP1.  The host is Windows 7 x64.  Originally the ping of the IP address had not worked either, but I had created an ICMP rule on the guest OS that allowed the echo request.  What is necessary to make the machine name "pingable?"
121221
I have a web server that I want to map a drive to it. I want to do this in a .bat file. Pseudo ->   Check if a drive at an ip address has been mapped to a local drive.  If it has then progress with a reference to the drive If not map to a local drive and then progress with a reference to the drive  Is this possible and if so how can I achieve it?
66598
I want to map the IP address 192.168.1.222 to 127.0.0.1 so that if I use 192.168.1.222 in the web browser or ping command I get the response (and that from my 127.0.0.1).   Is this possible via routing tables or do I have to add some sort of virtual network adapter?   I try to deal with this problem on a Windows 7 machine and have no other options than a Windows XP maybe.  I'm stuck right there.
123332
Pasted below this question is a sample of a /etc/hosts file from a Linux (CentOS) and a Windows machine. The Linux file has two tabbed entries after the IP address (that is localhost.localdomain localhost) and Windows has only one. If I want to edit the hosts file in Windows to have the machine name (etest) instead of localhost, I simply replace the word localhost with the machine name I want. The machine need not be part of a domain.  In a Linux machine, the two entries localhost.localdomain and localhost seems to indicate that I will need the machine to be part of a domain. Is this true?  Can I simply edit both entries to etest so that it will read:  127.0.0.1       etest etest   or is it required that I substitute one entry with a domain name?  Additionally, please let me know what the second line of the /etc/hosts file on the Linux machine is for.  ::1     localhost6.localdomain6 localhost6   hosts file on a Linux machine:  # Do not remove the following line, or various programs # that require network functionality will fail. 127.0.0.1       localhost.localdomain localhost ::1     localhost6.localdomain6 localhost6   hosts file on a windows machine:  # Copyright (c) 1993-1999 Microsoft Corp. # # This is a sample HOSTS file used by Microsoft TCP/IP for Windows. # # This file contains the mappings of IP addresses to host names. Each # entry should be kept on an individual line. The IP address should # be placed in the first column followed by the corresponding host name. # The IP address and the host name should be separated by at least one # space. # # Additionally, comments (such as these) may be inserted on individual # lines or following the machine name denoted by a '#' symbol. # # For example: # #      102.54.94.97     rhino.acme.com          # source server #       38.25.63.10     x.acme.com              # x client host  127.0.0.1       localhost
34899
I'm using Linux CentOS 6.4 .  I'm writing a shell script and I need to extract a machine's IP in order to use it in the script. How can I find the machine's IP?  I'm looking for the "best" way because I know there are a few ways to get IP addresses.  Thanks
87591
I have Ubuntu server 12.04 installed, so I have no GUI. When I do the command ifconfig, I cannot find my internal IP address. It says inet addr: 127.0.0.1. Here is the output of ifconfig -a: eth0   link encap:Ethernet  HWaddr 00:06:4f:4a:66:f0     BROADCAST MULTICAST  MTU:1500  Metric:1     RX packets:0 errors:0 dropped:0 overruns:0 frame:0     TX packets:0 errors:0 dropped:0 overruns:0 carrier:0     collisions:0 txqueuelen:1000     RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)  eth1   link encap:Ethernet  HWaddr 00:16:ec:05:c8:9c      BROADCAST MULTICAST  MTU:1500  Metric:1     RX packets:0 errors:0 dropped:0 overruns:0 frame:0     TX packets:0 errors:0 dropped:0 overruns:0 carrier:0     collisions:0 txqueuelen:1000     RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)  lo     Link encap:Local Loopback     inet addr 127.0.0.1  Mask:255.0.0.0     inet6 addr:  ::1/128 Scope:Host     UP LOOPBACK RUNNING MTU:65536  Metric:1     RX packets:1800 errors:0 dropped:0 overruns:0 frame:0     Tx packets:1800 errors:0 dropped:0 overruns:0 carrier:0     collisions:0 txqueuelen:0     RX bytes:143896 (143.b KB)  TX bytes:143896 (143.8 KB)  here are the contents of etc/network/interfaces: # The loopback network interface auto lo iface lo inet loopback  # The primary network interface auto eth0 iface eth0 inet dhcp  If someone could edit this for me, the contents of etc/network/interfaces should be on separate lines. The output of host askubuntu.com was: ;; connection timed out; no servers could be reached.  I set up owncloud and webmin a few months ago and was using them for a month with no problems. I think the power went off one day 2 months ago and I never turned the server back on until yesterday. I haven't done anything that would have affected the internet setup So i'm not sure why it doesn't work anymore. As far as my network topology goes, I have a pci-e network card for the pc. The ethernet line goes from the network card to a switch, and then to a modem/router from there.
61264
I have read the following properties from AD,  TerminalServicesProfilePath TerminalServicesHomeDirectory TerminalServicesHomeDrive   I've tried DirectoryEntry and DirectorySearcher. But they does not include the properties.  I found some example in vbscript and VC to read them. However I failed to make it working in C#. Am I missing some tricky thing?  EDIT: Am I have to run it on "Windows Server" to make it works? Can it be read from win XP?
34190
Is there a query in SQL Server 2005 I can use to get the server's IP or name?
7540
I know that the ip tool lets you bind multiple addresses to an interface (eg, ). Right now, though, I'm trying to build something on top of IPv6, and it would be really useful to have an entire block of addresses (say, a /64) available, so that programs could pick any address from the range and bind to that. Needless to say, attaching every IP from this range to an interface would take a while.  Does Linux support binding a whole block of addresses to an interface?