LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 04-14-2013, 12:37 PM   #1
Zzipo
LQ Newbie
 
Registered: Mar 2013
Posts: 28

Rep: Reputation: Disabled
Question 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!
 
Old 04-14-2013, 01:41 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
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.
 
Old 04-14-2013, 02:34 PM   #3
Zzipo
LQ Newbie
 
Registered: Mar 2013
Posts: 28

Original Poster
Rep: Reputation: Disabled
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?
 
Old 04-16-2013, 07:39 AM   #4
aburmot
LQ Newbie
 
Registered: Apr 2013
Posts: 5

Rep: Reputation: Disabled
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] binutils configure.guess - cannot guess build type bisonapp Linux From Scratch 3 01-09-2011 03:31 AM
Receive Ethernet VLAN frame on the native ethernet interface (raw packet socket) scottbiker Linux - Networking 0 07-13-2009 03:49 AM
Bridge between ethernet interface and tap interface jayadhanesh Linux - Networking 3 04-12-2009 11:32 PM
Ethernet interface vkmgeek Linux - General 1 03-15-2008 06:16 AM
how can i shutdown the PHYSICAL interface of an ethernet interface markraem Linux - Networking 2 04-12-2007 02:29 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 04:19 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration