Join Us!

VM public ip verifi...
 
Notifications
Clear all

VM public ip verification  

  RSS
afsfr
(@afsfr)
Junior Member

our VM is Linux based, NAT mode, no browser installed

VM is inside windows 8, windows 8 using wifi to connect internet and got public ip 217.13.2.*, default gateway is 10.2.*.*

so how to verify public ip and internet gateway of VM since no browser installed and ifconfig only show private ip? thanks

Quote
Posted : 24/10/2019 3:51 am
athulin
(@athulin)
Community Legend

so how to verify public ip and internet gateway of VM since no browser installed and ifconfig only show private ip? thanks

If the VM is configured (directly or indirectly) to use private networks, you have to identify and examine the point in the network where that private address is translated to a public address. In a physical network that would probably be a router or gateway that connected the private network with the public network. In a virtual network realized by the VM alone, there's likely to be some virtual router, or similar configuration. It may also be an existing host interface (physical or logical) used by the VMis used, in which case the details are probably primarily in the host network configuration.

You may be able to get by without a browser if you have wget or telnet/ssh clients or similar software on the client side, and a service like whatsmyip.com that echoes the IP from which your request was received. (This will only show you what your current public IP is, though; if there is fallback routing you won't discover all details this way.) On Windows, it used to be possible to fool the help reader into making web requests and show them in situations where full browser capability wasn't enabled. There may be similar bypasses in Linux. If you can sniff on the network traffic, you may get the information from ICMP message responses, such as ICMP Echo reply. And so on …

ReplyQuote
Posted : 24/10/2019 6:48 am
afsfr
(@afsfr)
Junior Member

there is no command line tool in Linux/Unix to know public ip? not only public ip, i want to know my public ip net mask and default gateway as well, we have no sniffer, wireshark installed and wget is prohibitted to use.

now we want to know public ip, mask, default gateway, how to?

ReplyQuote
Posted : 24/10/2019 9:53 am
jaclaz
(@jaclaz)
Community Legend

there is no command line tool in Linux/Unix to know public ip? not only public ip, i want to know my public ip net mask and default gateway as well, we have no sniffer, wireshark installed and wget is prohibitted to use.

now we want to know public ip, mask, default gateway, how to?

curl/dig/host+an online service, but your next post will be probably saying that you don't have it or you are not allowed to use it
https://opensource.com/article/18/5/how-find-ip-address-linux

But maybe there is a translation/communication issue, there is AFAIK no such thing as a "public" net mask nor default gateway. ?

Maybe you might be able to expand on the context ?

jaclaz

ReplyQuote
Posted : 24/10/2019 10:45 am
watcher
(@watcher)
Member

there is no command line tool in Linux/Unix to know public ip? not only public ip, i want to know my public ip net mask and default gateway as well, we have no sniffer, wireshark installed and wget is prohibitted to use.

now we want to know public ip, mask, default gateway, how to?

The catch is that your Public IP is in the router, which is doing network translation for your local IP.

That said try these from the Linux command line

dig +short myip.opendns.com @resolver1.opendns.com
dig TXT +short o-o.myaddr.l.google.com @ns1.google.com
and

route

ReplyQuote
Posted : 31/10/2019 4:59 pm
jaclaz
(@jaclaz)
Community Legend

Only for the record, fresh new kid on the block
https://about.ipv4.cat/

Discussion
https://news.ycombinator.com/item?id=21447055

Worth of note from the Author

The important point of difference here is that ipv4.cat is listening for any TCP connection, not just HTTP requests. This is probably most significant for Windows since no CLI HTTP client is included out of the box (with the exception of some PowerShell cmdlets). Even a telnet client isn't included by default in Windows nowadays. This is the most universal way (as far as I can tell) to obtain a public IP address from any operating system at a terminal - just type `ftp ipv4.cat`. That's why I think this is unique.

jaclaz

ReplyQuote
Posted : 05/11/2019 2:47 pm
maysr
(@maysr)
New Member

Have you tried running traceroute from the VM?

ReplyQuote
Posted : 06/11/2019 6:22 pm
watcher
(@watcher)
Member

Have you tried running traceroute from the VM?

Often that won't work because you only see the points where the TTL is decremented.

ReplyQuote
Posted : 07/11/2019 2:11 am
Share: