Networking a Mac and a PC both wirelessly and wired! *****s guide required.

By rednek ยท 23 replies
Jan 3, 2011
Post New Reply
  1. Hi

    I'm running a music studio with a PC (Win XP Home) and a MacBookPro (Snow Leopard).

    What I'd like to be able to do is the following:
    Have the PC and the MBP access the internet via their wireless connections (yup, I know, easy - done in fact),
    but also....
    Have the MBP and the PC talk to EACHOTHER via a wired connection: both machines have gigabit ethernet, and the mac, i'm told, will do the crossover automatically (ie negating the need for a crossover ethernet cable). I'd like to be able to transfer sets of large audio files from one machine to the other which, via wifi, takes forever; but I'd also like to have both machines access the internet independently of each other.

    I'm kind of asking if this is, in fact possible and, if so, how to do it.

    Also, what would be useful is to be able to run Synergy on both machines, so I can use the keyboard and mouse of the PC to operate both machines. This was easy when I had a PC laptop, but now I've switched to the mac, its all a bit different.

    Any help, suggestions, advice is, as always, extremely welcome.

    Kind Regards

  2. jobeard

    jobeard TS Ambassador Posts: 11,168   +986

    MBP?? What do you refer to?

    I have Win/XP, a Mac OSX, and RedHat linux all sharing files on the same subnet.
    Just connect (anyway you like to the router) and enable Print/File Sharing on all system.

    Google File Sharing Mac and PC to get the setup
    here's one example
  3. rednek

    rednek TS Rookie Topic Starter

    Hi JB,
    Many thanks for the quick response! MBP=mac book pro.
    Apologies for the ignorance, but will the method you suggest facilitate file sharing via ethernet only, and access to the internet via wifi only? This is what I need to be able to do.
    Kind Regards
  4. jobeard

    jobeard TS Ambassador Posts: 11,168   +986

    hmm; You want any system wired to the router to enable file sharing
    but at the same time, ONLY WiFi connections to have Internet access? very unique setup and could be complex to achieve.
    Before we launch off into left field, what is the concept you're attempting to implement; protect files from Internet access?
  5. rednek

    rednek TS Rookie Topic Starter

    Correct. I have no wired internet access in the music studio, but can access the wifi in the house (next to the studio). Wifi will enable me to transfer files between the mac an PC, but it is so slow compared to gigabit ethernet and makes the transferring of large sets of audio files very time consuming.

    I could always switch off the wifi on one of the boxes and switch the ethernet port on I can get the fast transfer speeds, but it would be more convenient I didn't have to climb behind my rig every time I need to transfer a file.
  6. jobeard

    jobeard TS Ambassador Posts: 11,168   +986

    Let me show you the normal setup and then discuss it:

    The typical in-home LAN looks like
              +- - (wireless) - - -  if so equipped - -
    File Sharing can be enabled on systems safely AS LONG AS
    you never port forward 137-139, 445

    Using various features of routers+firewalls, you can inhibit any unknown
    systems from accessing your router and/or at least deny file sharing to them.

    The above works well - - so why restrict wireless differently than wired? Can't you use this setup? If not, please clarify why not.
  7. SNGX1275

    SNGX1275 TS Forces Special Posts: 10,742   +421

    I think there might be some confusion. Here is how I see what rednek is saying:
    The problem is he doesn't have wired internet access, only wireless. He can share over wireless, but even Wireless N speeds suck compared to gigabit. He can achieve gigabit wired - without a router connecting them, by just using a regular cat-5 cable. He wants to share between the comps this way rather than wireless. So he is using a router, but wants that for wireless internet connectivity only.

    Its like, I have 2 laptops on the same table upstairs, wireless router is downstairs so I can't easily run a wire from each to the router. I can share files between them, but it has to travel over the air, which is slow compared to over a wire. So it would be ideal if I had a short cat-5 cable to just plug into each's ethernet port and send files that way.
  8. rednek

    rednek TS Rookie Topic Starter

    Exactly right. Its the speed at which I can transfer the files between the two computers which will make the real difference.
  9. rednek

    rednek TS Rookie Topic Starter

    I need both PC and Mac able to access the internet independently if each other, as I cannot access the modem/router with cable, only wireless - its in a different part of the building and I'm not able to install a CAT5 network through the house. Also, even if I could, my router is only 100mb, and I could really use the speed of a gigabit connection.
  10. Leeky

    Leeky TS Evangelist Posts: 3,797   +117

    So you want to connect both computers via Ethernet and take advantage of gigabit speed?

    I presume you can connect via wire though, because your above statement makes it sound like running cable in your house can't be done?
  11. rednek

    rednek TS Rookie Topic Starter

    Yup, the mac and the pc spend a lot of the time in the same room, ie, when I'm working on music projects. And this is when I'd need the gigabit speed. However, the modem/router is not in this room, its in the main house and I can't run a cable to where it is., so have to access the internet via a wireless connection. Even if I could I'd still only get 100mb unless I bought a gigabit switch.

    I don't need a crossover cable, as the mac auto-detects, which is useful.
  12. jobeard

    jobeard TS Ambassador Posts: 11,168   +986

    I was only attempting to the the O.P. to see the simpilicity of using the router itself.

    Of course the alternative is
    Modem===Router - - wifi - - system#1--wired---system#2
    You need to emable Internet Connection Sharing on the PC which will cause the
    NIC attached to the cable to have an forced address of (gee thanks MS.) and the other side will be
    This then requires that your router not have these addresses and you will need to configure it
    for something like

    The downside of this arrangement is system#1 must be running if system#2 is to have Internet access.

    There's a complicated alternative
    Modem===Router - - wifi - - system#1--wired---system#2
                 |                                   ^
                 V                                   |
                 + - - - - - - - - - - - - - - - - - +
    but I have to jump off for a job - - I'll explain tonight
  13. rednek

    rednek TS Rookie Topic Starter

    Its this second option which would be of most interest. Many thanks JB; hope the job goes well, and look forward to hearing from you soon.
  14. jobeard

    jobeard TS Ambassador Posts: 11,168   +986

    yea, I guessed as much :)

    Ok; everyone knows this part; just two wifi connections and both have Internet Service
    Modem===Router - - wifi - - system#1        system#2
                 |                                   ^
                 V                                   |
                 + - - - - - - - - - - - - - - - - - +
    With both systems running and connected to the router, you should be able to ping
    on system#1; ping system#2's address
    on system#2; ping system#1's address​

    here's the tricky addition
    Modem===Router - - wifi - - [B]system#1---wired---system#2[/B]
                 |                                   ^
                 V                                   |
                 + - - - - - - - - - - - - - - - - - +
    Both wifi settings system#1 & #2 need the Gateway address to be that of the router. This you alread have if both have Internet Service.

    All the wired stuff will need static assignments on both sides. I'll refer to the new setup for wired as System#x Nic2
    (implying the wired connection. leave all wifi settings as-as).

    I also assume your router is at (correct me as needed)

    First get the WiFi settings from system#1 using ipconfig /all and report
    • IP Address. . . . . . . . . . . . . :
    • Subnet Mask . . . . . . . . . . . :
    • Default Gateway . . . . . . . . . :
    • DHCP Server . . . . . . . . . . . :
    • DNS Servers . . . . . . . . . . . . :

    the above are used to seed the static settings.

    For now, focus on the config, not the how-to

    we config system#1 Nic#2 like
    • IP Address. . . . . . . . . . . . . :
    • Subnet Mask . . . . . . . . . . . :
    • Default Gateway . . . . . . . . . :
    • DHCP Server . . . . . . . . . . . :
    • DNS Servers . . . . . . . . . . . . :

    we config system#2 Nic#2 like
    • IP Address. . . . . . . . . . . . . :
    • Subnet Mask . . . . . . . . . . . :
    • Default Gateway . . . . . . . . . :
    • DHCP Server . . . . . . . . . . . :
    • DNS Servers . . . . . . . . . . . . :
    Notice the IP of one system is the gateway address in the other system.

    to make sharing much easier, let's call system#1 Mickey and system#2 Donald
    We add Mickey and Donald to the top of the
    \windows\system32\drivers\etc\hosts file like
    # this one will already exist
    [COLOR="Gray"]     localhost[/COLOR]
    ## you add these two
    [COLOR="Teal"]  mickey[/color]
    [COLOR="Red"]   donald[/color]
    Obviously you can use anything you like other than mickey and donald :)

    to get the updated hosts file to be used, we need to bounce (stop/restart) like this
    net stop "dns client"
    net start "dns client"​
    and the quotes are required.

    you should NOW be able to ping
    on system#1;  ping system#2's address
       also ping donald
    on system#2;  ping system#1's address
       also ping mickey
    Once you can pind donald & mickey then \\donald\sharedDocs and \\mickey\\shareDocs will work.

    DO NOT USE INTERNET CONNECTION SHARING! this will just mess up the whole thing.
    Whatever firewall you are using, you enable Print/File Sharing on both systems.
    If necessary, you can manually configure network access
    allow  in    tcp/udp  src-ip 192.168.11.* input-ports 137-139+445
    allow  out   tcp/udp  dst-ip 192.168.11.* output-ports 137-139+445
    Whew! let's see how you stand on just understanding the above concepts - - - -
  15. rednek

    rednek TS Rookie Topic Starter

    Hi JB

    Many thanks for this. It WORKS!!!!! Lovely fast file transfer between mac and pc in the studio, and independent internet access. Top man!


    The internet access only works on either machine when the ethernet cable is unplugged, ie, when there is no physical connection between the two machines. Its like as soon as you connect them via ethernet, they both look to that port for internet access, over-riding the wireless connection.

    I can easily just unplug the cable and have internet access immediately restored, but this is a little inelegant. It would be nice to be able to go on the net whilst waiting for files to transfer, for example.

    Would you know of a solution to this?

    Kind Regards

  16. jobeard

    jobeard TS Ambassador Posts: 11,168   +986

    Good Job Red :wave:
    I'll have to think about it ; get me some data please.

    connect everything and on Donald (system#2) run this

    ipconfig /all >sys2Tcp.txt
    netstat -r >sys2Routes.txt
    attach both to your follow-up
  17. rednek

    rednek TS Rookie Topic Starter

    system 2 (Donald) is a mac. Would you happen to know similar commands for the terminal console?
  18. jobeard

    jobeard TS Ambassador Posts: 11,168   +986

    I'll look it up, but substitute System#1 - - it's just as good
  19. jobeard

    jobeard TS Ambassador Posts: 11,168   +986

    fyi: for future use:

    Applications->Utilities->Launch Terminal
    (this is the Mac/FreeBSD interface aka xterm and ~like Windows Command Prompt)

    the command comparisons are
    Windows      ->  Mac Equiv
    netstat -r       netstat -r
    ipconfig /all    ifconfig
    Not in the above cases, but sometimes you need root access.
    To do that, enter su with no parms and then enter the root password
    You can google for How to enable Root on OSX and if you do, be sure to give it a
    new password (and record it!)
  20. rednek

    rednek TS Rookie Topic Starter

    Hi JB
    system 1 attached.

    Attached Files:

  21. jobeard

    jobeard TS Ambassador Posts: 11,168   +986

    Here's the scoop
    Active Routes:
    Network Destination     Netmask          Gateway       Interface  Metric
         	192.168.11.[COLOR="Blue"]4[/COLOR]	  [COLOR="Red"]10[/COLOR]
    Default Gateway:      192.168.11.[COLOR="Blue"]4[/COLOR]
    the Metric for the WiFi is 25 and that of the ethernet is 10::
    ergo the ethernet link is considered to be 'faster' and is chosen as the Default Gateway :(

    You're going to need a script to correct this as TCP is making the choice for the Metric as the link becomes active.

    A) I assume you normally will have WiFi by default and the ethernet wired link sys#1->sys#2 will be far less frequently be active.

    B) so we'll fitz with the wired connection in the script. Sadly, you will need to do this on each system and the scripts will be different (aka Mac vs Win).

    [1] For the Windows Side: using Admin login or runas admin
    route -p add MASK METRIC 30 if 2

    [2]For the Mac Side: run under root (su)
    route -n add default -net -netmask -hopcount 30

    Suggest you address one system at a time, eg: use [1] by itself without -p to ensure wifi takes precedence when the ethernet is attached. You will be able to do one way actions PC=> mac and yet still browse.
    Once correct, add -p to [1]. Once you've used the -p,
    you should not need it again (but test after rebooting the pc to be sure)

    on [2]: run manually and then test for Mac=>PC and still able to use the browser.
    Once this works, the chore is to make it permanent

    Get a Terminal,
    su to root
    cd /etc
    ls rc.local
    if not found
    touch rc.local​
    look what you have ls -F rc*
    typically you'll see rc rc.boot rc.common rc.netboot [you just added rc.local]

    the RC file drives all the other stuff and the last logic in RC reads
    if [ -f /etc/rc.local ] then # if this file exists
    sh /etc/rc.local # then run it with the SH shell

    Every time the network is started, rc.local will be the last thing attemped.

    Now edit /etc/rc.local and insert
    route -n add default -net -netmask -hopcount 30
    exit 0
  22. rednek

    rednek TS Rookie Topic Starter

    Many thanks for this JB. As luck would have it, my ISP is upgrading my line today, and I'm going to get intermittent internet access for the next 2 - 3 days!!! So rather than trying to work out if its the new config or the ISP preventing internet access I'm going to postpone this operation til after the weekend, when I shall resume in earnest, and will report back on the results of your last post.

    Once again, extremely grateful for your time and considerable expertise.

    Kind Regards

  23. jobeard

    jobeard TS Ambassador Posts: 11,168   +986

    I Expect one more issue to occur, but don't fret - -
    need to add specific route for to 168.11.4 and
    converse on the other machine to​
    Now I will be out of the office on Thrus, returning Friday.
  24. rednek

    rednek TS Rookie Topic Starter

    Hi JB. I think I've sorted it. I just left the default gateway and dns server entries blank, and all is well. Many thanks for your time - I'm very grateful.

Similar Topics

Add your comment to this article

You need to be a member to leave a comment. Join thousands of tech enthusiasts and participate.
TechSpot Account You may also...