Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
04-14-2013, 12:37 PM
|
#1
|
LQ Newbie
Registered: Mar 2013
Posts: 28
Rep: 
|
Is possible to guess IP in ethernet interface?
Hello,
I am not asking how to do this (although always more info is welcome), but If is it possible to guess the gateway address of a network in a interface.
Case a)
Computer A connected directly through ethernet to another Computer B. Computer B has its eth0 in a specific network (e.g., 10.0.0.1, etc)
Case b)
Computer A connected through WLAN or Ethernet switch to a network created by Computer B (also connected).
In both cases:
Computer A wants to know which is the network to can "communicate" with Computer B.
There is no DHCP, just static IP.
Doing ping is not possible "Network is unreachable". But I don't know with nmap, arp-scan,...
Thanks!
|
|
|
04-14-2013, 01:41 PM
|
#2
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417
|
neither of your examples have anything to do with "gateways" at all... this is just flat ethernet networking. You can sniff traffic and see what networks are being asked for, but past that, no there's no formal way to discover a the address details for a subnet officially, it's not part of the spec at all.
|
|
|
04-14-2013, 02:34 PM
|
#3
|
LQ Newbie
Registered: Mar 2013
Posts: 28
Original Poster
Rep: 
|
Maybe I express myself wrong.
I said gateway because I was thinking that behind the Computer B, it is connected to another network that provides Internet connection. And it is forwarded to eth0 of Computer B (through, lets say, its 10.0.0.1).
So, the only way is through a packet analyzer like Wireshark, and trying to obtain packets.
But in the case A would be impossible, isn't it? Because you are the only computer connected to B.
So, there is no way to do something like:
Test 1:
sudo ip addr add 10.0.0.120/24 dev enp2s0
sudo ip link set up dev enp2s0
ping -c 1 10.0.0.1
Test 2:
ping -c 1 10.0.0.2
etc...
Until receive packet.
And the same for all IP.
That is the only way?
|
|
|
04-16-2013, 07:39 AM
|
#4
|
LQ Newbie
Registered: Apr 2013
Posts: 5
Rep: 
|
Scanning and sniffing
I know two methods of network investigating - scanning and sniffing.
As you mentioned nmap and arp-scan, I think that you know about scanning. In case you don't know actual networks parameters, you can use something to start - e.g. 169.254.x.y. To send packets to any address directly you should set default gw to the address of own interface.
I prefer sniffing. Actually, hosts and network equipment often send packets to discover something via broadcast. How often - it depends. Maybe you'll never see any packets. But in fact any host should at least check for duplicate IP, while starting up network interfaces. So you may sniff something.
Last edited by aburmot; 04-16-2013 at 07:39 AM.
Reason: Spelling
|
|
|
All times are GMT -5. The time now is 04:19 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|