By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,222 Members | 2,354 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,222 IT Pros & Developers. It's quick & easy.

NIC adress of incoming socket.

P: n/a
How can i know the nic adress from an incoming socket ?
I can easily know the ip adress and port number but how do i have some
information about arp level ?

Thanks
Jul 18 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Am Fr, den 14.05.2004 schrieb RosalieM um 18:40:
How can i know the nic adress from an incoming socket ?
I can easily know the ip adress and port number but how do i have some
information about arp level ?

There is no portable way?

Andreas

Jul 18 '05 #2

P: n/a
RosalieM wrote:
How can i know the nic adress from an incoming socket ?
I can easily know the ip adress and port number but how do i have some
information about arp level ?


In addition to Andreas' answer: I'm not even sure the problem
has a well-defined solution in general. Isn't it possible
that individual packets in the data stream (assuming this
is TCP, for example) can be routed through different
networks (and, therefore, different NICs) on some machines?

If you want to limit this to the simple case of one NIC
per machine, then you still need to resort to platform-specific
things like parsing the output of some external command
to match up IP address and "NIC address" (which is also
not necessarily well-defined, but I assume you mean Ethernet
address there).

-Peter
Jul 18 '05 #3

P: n/a

"Peter Hansen" <pe***@engcorp.com> a écrit dans le message de
news:na********************@powergate.ca...
RosalieM wrote:
How can i know the nic adress from an incoming socket ?
I can easily know the ip adress and port number but how do i have some
information about arp level ?


In addition to Andreas' answer: I'm not even sure the problem
has a well-defined solution in general. Isn't it possible
that individual packets in the data stream (assuming this
is TCP, for example) can be routed through different
networks (and, therefore, different NICs) on some machines?

If you want to limit this to the simple case of one NIC
per machine, then you still need to resort to platform-specific
things like parsing the output of some external command
to match up IP address and "NIC address" (which is also
not necessarily well-defined, but I assume you mean Ethernet
address there).

-Peter


I saw in dhcpd config for bootp that you give the adress of the nic. How
can i be sure that in my lan it is the right computer (my dhcp server) that
answers to my client and not another compromised machine ? Can i ask python
some information from ethernet level in an ip connection?
Jul 18 '05 #4

P: n/a
RosalieM wrote:
I saw in dhcpd config for bootp that you give the adress of the nic. How
can i be sure that in my lan it is the right computer (my dhcp server) that
answers to my client and not another compromised machine ? Can i ask python
some information from ethernet level in an ip connection?


Basically, no. Use external utilities to solve whatever the
problem is. I'd suggest that if you might have compromised
machines on your own LAN which are answering in place of your
real DHCP server, you have rather big problems to solve, and
you'd be best involving a network administrator with a good
understanding of security issues.

-Peter
Jul 18 '05 #5

P: n/a

"Peter Hansen" <pe***@engcorp.com> a écrit dans le message de
news:Cp********************@powergate.ca...
RosalieM wrote:
I saw in dhcpd config for bootp that you give the adress of the nic. How can i be sure that in my lan it is the right computer (my dhcp server) that answers to my client and not another compromised machine ? Can i ask python some information from ethernet level in an ip connection?


Basically, no. Use external utilities to solve whatever the
problem is. I'd suggest that if you might have compromised
machines on your own LAN which are answering in place of your
real DHCP server, you have rather big problems to solve, and
you'd be best involving a network administrator with a good
understanding of security issues.

-Peter


I saw that this could be a security issue. So i would like to prevent it.
And i would like to be able to do what dhcpd and tftp are able to do, to say
check the nic before sending files. But I wanted to write this program in
python as i found in google a dhcpd program writen in python.

You mean that python cant do it ? I read that python can do everything
possible.
Jul 18 '05 #6

P: n/a
RosalieM wrote:
I saw that this could be a security issue. So i would like to prevent it.
And i would like to be able to do what dhcpd and tftp are able to do, to say
check the nic before sending files. But I wanted to write this program in
python as i found in google a dhcpd program writen in python.

You mean that python cant do it ? I read that python can do everything
possible.


Where did you read that? It needs to be corrected...
Jul 18 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.