I've got several PCs, virtual and bare metal, that run clients of the collectd daemon and report their statuses to the monitoring server.
One of those PCs is incorrectly configured and reports localhost as its name.
How can I find its IP address?
The simple answer would be to run a tcpdump on the port used for collectd (port 2003 for example) and check the different IPs.
run ssh and pipe directly to the config file to see which one has the wrong host set:
echo "sudo nano /etc/collectd/collectd.conf | grep "Host" | ssh user#IP
Related
We are transitioning (we hope) from CoreOS to CentOS, from fleet to swarm. I need to determine the ip address of the machine running docker from inside the container.
The problem is that we use nginx to determine which of the machines in our docker cluster runs which service. To make this work we need the container to be able to post to our etcd repository the ip address of the machine upon which it is located. Everything I have seen so far has been able to get me to a 172.17.0.1 ip address for the external machine, but ALL of our containers on ALL of our dockers will have that private address. I need an EXTERNAL address that nginx may use to get to the service.
I could use the '--hostname ip ...' option or the '-e EXT_HOST_IP=ip ...' option to set an ip address, but if I include these in the 'docker run' command, the shell processing the docker command will expand the 'ip...' and return the ip address of the current machine -- NOT the machine upon which swarm will eventually run the container.
The best I have come up with so far is to create a file/directory on the host machine that contains the ip address of the host machine. I can then use the docker '-v' option to mount the directory inside the container, and get the ip address from that. It just seems like there should be an easier way to do this.
Swarm issue 1106 mentions in a recent answer
inside swarm I can get the ip of the host machine like so
ip route | awk '/default/ { print $3 }'
Which is fine for many purposes.
But when I talk to that IP I need to use the proper dns name for TLS to work.
I am trying to connect two virtual machines Ubuntu and Windows (the host is Windows) on VMWare Workstation to test the sending of Mosquitto messages (MQTT) between the two machines, but I am a novice in network art. So I have no idea on how to proceed. I have tried to set an IP adress to each machine with the option "Custom virtual network" but it's not working...
Please help me on this.
I finally could make it work :
The two machines have to be connected with NAT
The Windows firewall has to be disabled
The IP address of the subscribed machine has to be specified in the mosquitto line command when testing the sending of MQTT messages between the two machines.
mosquitto_pub -h [IP address] -t test -l
If not, mosquitto send messages to the local host by default.
I have Windows 10 as host with a Manjaro installation as Guest on Virtualbox.
I have set a Debian server on another house with ssh installed. I have setup a dyndns on Debian's network so I can access it remotely.
For example..
From address 12.34.56.78 I ssh to foo.dyndns.org:1234. This port redirects me to 192.168.1.5:22 always as this is my Debian machine and the connection is established. I am able to do this from Windows 10 as well as my android and any other device in 12.34.56.78 or by 3G.
But..
When I try to do this
$ ssh foo.dyndns.org:1234
from the Manjaro Guest in Virtualbox I get the following error:
ssh: Could not resolve hostname foo.dyndns.org:1234: Name or service not known
So I did ifconfig and I saw my inet address was 10.0.2.15. I changed virtualbox's network adapter from NAT to Bridged so I can get a lan ip and I got the host's ip, 192.168.2.4. So I gave it another try and still didn't work.
Also, if i try to connect from vm to server while I'm in the same network
$ ssh user#192.168.2.5:22
it works. In this case virtualbox's network adapter was NAT.
This command works if I try from my android (connectbot).
I can connect the same way from PuTTY from Windows.
So my questions are:
Can it be done?
If so, how? (and why?)
Can a VBox Guest get lan ip that's not the same as the host's?
Is there any more information I should provide?
I have searched for a couple of days in here and on google and all I found where solutions on how someone can ssh INTO a vm. No one (from what I saw) asked the opposite.
Checking manual page for ssh reveals the format of command-line options:
ssh [...] [-p port] [...] [user#]hostnamessh
This simply describes, that you need to change
ssh foo.dyndns.org:1234
to
ssh -p 1234 foo.dyndns.org
if the domain resolves correctly to the ip address.
My environment has 2 hosts and a VM on each host. NVGRE tunnel is created, as VMs and Hosts belongs to different subnets. I am using Windows server 2012 R2 hosts and same VMs. Hosts are connected back to back. If I put VMs and Hosts in same subnet Ping works.
Both the VMs are receiving ARP requests and responses from each other. ARP cache of each VM is having dynamic entry of other VM.
BUT ICMP request packet from VM is not even seen on its Host.
You cannnot just ping from one host to another host.
To ping provider address from your host, -p option is needed.
Example:
$address = (Get-NetVirtualizationProviderAddress).ProviderAddress
ping -p $address
Please put virtualization lookup records when you need more help.
Run following commands as administrator.
Get-NetVirtualizationLookupRecord
Get-NetVirtualizationCustomerRoute
Also make sure your VM's firewall allows ICMP echo.
I have a host laptop running Debian, and a client VM running Debian. On the client, I run NGINX, and it serves up a complex web application with several hostnames (e.g. www.host, api.host, blog.host). The laptop moves between several different networks, with a seemingly ever-changing IP address.
I'm trying to meet the following conditions with this VM:
The IP address of the client shouldn't change (e.g. always 192.168.10.10)
With a static IP, I could edit the host /etc/hosts file and keep complex hostnames
The client should have access to the Internet
No other machines need to access the client
What is the best way to set up the Attached to settings for this client?
To do this, simply add two network interfaces to the box.
The first interface will use Host-Only, and that is how your host can connect to the client. This will create an additional network adapter on the host.
The second interface will use NAT, and that is the gateway to the internet. This will create an additional network adapter on the client.
If you've already got a client running, you'll need to get the next network adapter up and running by executing sudo ifconfig eth1 up and to get an IP address, run sudo dhclient eth1.