how do I force use of hosts file?

  • Follow


I have a winsock app to send udp datagrams to an embedded controller. I put the
eth add of the controller in the arp table, and I put the 'dummy' ip add in a
line in the hosts file. So I create the socket and fill in the ip addr, it
should look up the eth addr in the arp table, right?
I have an entry in the hosts file with the ip address and ethernet address of
my device. When I open the socket to that ip address, the sniffer shows it
sending the packet off to the default gateway. This all worked last week till
the network guy changed everything from 192.168.1.1 thru 200 to 5.1 thru 5.99.
My device is still 192.168.1.200. I should be able to send a udp datagram to
that ip addr, and have it look up the eth addr in the host file, right? What
got messed up and how do I change it back?!? Thanks!

0
Reply bobgardner225 (14) 5/25/2004 7:44:11 PM

bobgardner@aol.comma (BobGardner) wrote in
news:20040525154411.09206.00002071@mb-m13.aol.com: 

> I have a winsock app to send udp datagrams to an embedded
> controller. I put the eth add of the controller in the arp table,
> and I put the 'dummy' ip add in a line in the hosts file. So I
> create the socket and fill in the ip addr, it should look up the
> eth addr in the arp table, right? 

If it is in the same subnet as your device, it will.  If it is in a 
different subnet (or thinks it is), then it will send the packet to the 
gateway device.

> [...] I should be able to send a udp datagram to that ip addr, and
> have it look up the eth addr in the host file, right? 

The hosts file will convert an IP _name_ to an IP _address_.  Given the 
IP address, the _Ethernet_ address will be looked-up in the ARP table  
if it hasn't expired from there and found by broadcast if it has.

It sounds as if your network admin has moved all devices into a 
different subnet except your machine so your machine is always 
searching for the gateway device to route packets to the destination.  
Type "netstat -rn" to see the routing table and see how your packets 
will be routed.

HTH,
  John
0
Reply John 5/26/2004 8:36:05 PM


1 Replies
714 Views

(page loaded in 0.037 seconds)

Similiar Articles:













7/23/2012 10:56:04 AM


Reply: