Thread: PC as a router

  1. #1
    Registered User C_ntua's Avatar
    Join Date
    Jun 2008
    Posts
    1,853

    PC as a router

    One PC is connected on the internet through a mobile broadband network, using a USB device. I want to connect to that computer another one and both have internet access. Is there a way to make the first computer to act as a router?
    The PCs have only network cards, so I will connect them with an ethernet cable.

    I guess I need some kind of software to achieve this?

  2. #2
    Master Apprentice phantomotap's Avatar
    Join Date
    Jan 2008
    Posts
    5,108
    OS? Intent?

    Soma

  3. #3
    Registered User C_ntua's Avatar
    Join Date
    Jun 2008
    Posts
    1,853
    Oh, sorry.
    The PC with the internet access has XP and the other Windows 7.
    My intent? For both PCs to have internet without needing to buy any additional hardware.

  4. #4
    Registered User
    Join Date
    Sep 2008
    Posts
    48
    "Internet connection sharing" should do what you need with just a few clicks. Look it up on google.

  5. #5
    Registered User
    Join Date
    Dec 2006
    Location
    Canada
    Posts
    3,229
    You'll need 2 network cards on the sharing PC, though.

    Not sure about Windows, but there's a way to do it with just one card in Linux (2 virtual interfaces), gets very messy.

  6. #6
    Registered User C_ntua's Avatar
    Join Date
    Jun 2008
    Posts
    1,853
    That article is maybe what I want. I will check it out.
    Why 2 network cards? I will connect the two PCs with ethernet and one computer will access the internet with a USB connecting to a cellular network.

  7. #7
    Registered User
    Join Date
    Dec 2006
    Location
    Canada
    Posts
    3,229
    Ohhh I see.

    The second card would be the USB card.

    I thought it's regular ethernet.

  8. #8
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    Easy, just get a cross-over cable and you're done . Although that's not a scalable solution if you want to add another computer, perhaps consider a router?
    Last edited by zacs7; 04-22-2010 at 04:32 PM.

  9. #9
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    Quote Originally Posted by zacs7 View Post
    Easy, just get a cross-over cable and you're done . Although that's not a scalable solution if you want to add another computer, perhaps consider a router?
    With a modern NIC, it doesn't matter whether the cable is cross-over or not. The interface will figure out what kind of cable it is and remap its pins. Cool, huh?

    But it's not quite "done" yet, you still need to enable routing on the host machine. I haven't done it myself, but this looks like how you do it:

    How to Enable IP Packet Forwarding (Windows NT/2000/XP)

    That will allow packets from the Win7 machine to route out through the XP machine. You'll need to configure some kind of SNAT on the XP box to do the address translation (probably through some magic using the "netsh" command)
    Last edited by brewbuck; 04-22-2010 at 04:59 PM.
    Code:
    //try
    //{
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);
    //}

  10. #10
    Registered User C_ntua's Avatar
    Join Date
    Jun 2008
    Posts
    1,853
    Wanted to have the Windows 7 PC to be connected and couldn't make it work for nothing! I believe the problem is that windows are too stupid to set up a simple home network correctly.
    So went to set it up having the internet on the Windows XP PC. Found a good tutorial to do so. You simply go to the Network Wizard and select the first option and everything is done automatically.
    Thanks for the help. I was about start making a program to redirect packages and stuff to the USB port, but hopefully I saved myself tons of trouble.

  11. #11
    Registered User
    Join Date
    Aug 2008
    Location
    Croatia
    Posts
    36
    Not sure how you do it in Windows(somewhere in registry I guess), but in Linux you only need to setup the routing table manually or by some routing protocols and enable forwarding in /proc/sys/net/ipv4/ip_forward.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. my pc and laptop can't see my router
    By kypronite in forum Networking/Device Communication
    Replies: 4
    Last Post: 10-29-2009, 07:32 PM
  2. DHCP & Router
    By Cactus_Hugger in forum Tech Board
    Replies: 1
    Last Post: 07-26-2009, 10:05 PM
  3. Replies: 1
    Last Post: 10-27-2006, 01:21 PM
  4. Damn router
    By RoD in forum Tech Board
    Replies: 7
    Last Post: 05-04-2004, 02:27 PM
  5. Post you pc pics (mods)
    By biosninja in forum A Brief History of Cprogramming.com
    Replies: 33
    Last Post: 03-15-2004, 04:15 PM