Jump to content

Check out our Community Blogs

Register and join over 40,000 other developers!

Recent Status Updates

View All Updates

- - - - -

Connecting Linux to Windows

linux windows tcp/ip

This topic has been archived. This means that you cannot reply to this topic.
2 replies to this topic

#1 KansaiRobot


    CC Resident

  • Advanced Member
  • PipPipPipPip
  • 82 posts

Posted 18 January 2014 - 12:28 AM

Thank you always for all your help. It is greatly appreciated :)


I havent finished solving my last problem and yet I have another one, more urgent. Seeing it from afar I think it is quite simple, but my knowledge is limited and I would appreciate your help.


Unfortunatelly it deals with windows :o as well as Linux.


The Goal: I have to connect a linux machine (microprocessor really) with a windows PC.


Take a look at the image to see the environment I am working with environment.jpg


As you can see there is a virtual machine inside the PC in which I use (a variant of ) Debian Linux. I can connect the machines either through USB (virtual LAN) or cross cable LAN. I have succesfully written programs for both sides to pass text or images. They are working with both USB or LAN (I have to modify the interfaces file in the PC to be able to use the LAN.


Now, I have to do the same but without using the virtual machine, ergo connect directly to the windows machine. I learned some of winsock and wrote a basic program that will do the same thing the program on Debian did.


The question: How do I set up the network in windows (I have nil knowledge about this)


So far I think it is on DHCP.


What I have done so far (and failed):


First, when I connected to Debian, the programs recognize the hostname (it is written in Hosts? or hostname file in the linux systems) so I didnt have to use IP adresses. The windows machine cant recognize the hostname of my microprocessor. (Is there a way to set this in windows similar to hosts in linux??)


Second, I tried to use static IPs so I modified the interfaces file on the microprocessor.

Then I did ifdown -a and ifup -a  and now I got a weird error

>ifdown -a
interface eth0 not configured
>ifup -a
ip:either "local" is duplicate, or "/24" is garbage
ip: RTNETLINK answers: File exists

I have no idea what this means.. :confused:


Also there is something I find weird. When I see the hosts file in the microprocessor I see localhost mymicroproc
::1 localhost.v6

Isnt it suppose to be in the second line?? :confused:  at least that is how it is on the Debian system


Anyway, sorry for the long post, I think the main simple question is what kinds of configuration I have to give the windows machine and the linux micro to make them communicate with my socket programs?? (it is a private network, no need to connect to the internet)


A thousand thanks to anyone who can help me. I am in really need of this as soon as I can

Thank you again



Edited by Roger, 18 January 2014 - 09:52 AM.
added tags

#2 WingedPanther73


    A spammer's worst nightmare

  • Moderator
  • 17757 posts

Posted 20 January 2014 - 06:09 AM

If you do ifconfig on your microprocessor, what do you get?


In general, if you're connecting via LAN, you have to make sure your windows machine, linux box, AND router are all playing nicely together. Windows can do some odd things about "seeing" linux computers, but I wouldn't think it'll be too difficult. My first question would be: does your router see all the devices as being on the LAN?

Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

My MineCraft server site: http://banishedwings.enjin.com/

#3 KansaiRobot


    CC Resident

  • Advanced Member
  • PipPipPipPip
  • 82 posts

Posted 21 January 2014 - 05:27 PM

Thanks for the reply.


So far I have connected the two with a crosscable. 

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download