NIC adress of incoming socket.

R

RosalieM

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
 
A

Andreas Kostyrka

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
 
P

Peter Hansen

RosalieM said:
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
 
R

RosalieM

Peter Hansen said:
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?
 
P

Peter Hansen

RosalieM said:
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
 
R

RosalieM

Peter Hansen said:
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.
 
P

Peter Hansen

RosalieM said:
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...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top