0

I am wondering if it is possible to use one network card to access two subnet in windows. I need to access a (LAN) local ip 192.168.0.5/255.255.255.0 and WAN with DHCP. I google that someone suggests to set two ip addresses to one NIC but I don't understand how to do that if the IP for WAN is from DHCP. Do I really have to use router? I don't know much about router, can I use a HUB instead to work it out?

Some more information and first trial

It is used in my office. Total have 5 computers connected to the wall socket (WAN), IP is DHCP. I have one device with ip set to 192.168.0.5/255.255.255.0 which is accessible by tcp/ip, so I need to setup the network card to the same subnet to access that device. However, if I setup the network card in that subnet, I cannot use the WAN. I am looking for a way to use both. Even I see that someone use setup two ip addresses to one NIC but there is only one port in the NIC so I think we still need a router to do so? I borrow a router, have the WAN port connect to the wall socket, one LAN port connect to the NIC and connect another LAN port to the device of 192.168.0.5 With this setup, I can access WAN and that local device without any problem. However, all other the computers (connect to WAN via the wall socket) in my office can no longer access the share folder in my computer any more. I don't know what's going on.

4
  • Can't help with the Windows specific bits, but no, you can't use a HUB to work it out. You might be able to circumvent the problem by finding an IP address in the subnet the DHCP server gives out, - but outside the range allocated for DHCP and statically assign this to your router - SO AT A GUESS 192.168.0.253, gateway 255.255.255.0, no gateway.
    – davidgo
    Commented Oct 23, 2013 at 7:05
  • Can you please give more details? Is this a home user scenario? How many network devices are used, what is the IP config of these devices? Commented Oct 23, 2013 at 7:12
  • The answer is yes, absolutely - use a router. Forget about hubs
    – Ashtray
    Commented Oct 23, 2013 at 7:14
  • 1
    If you can get a static IP for the WAN (ask your admin for that) then you can use this solution: http://superuser.com/questions/571575/connect-to-two-lan-networks-with-a-single-card.
    – Hennes
    Commented Oct 23, 2013 at 8:08

1 Answer 1

0

Do I really have to use router?

You can simply add a second NIC to your system (use a USB one if this is a laptop) - you can then access the WAN with one NIC, and the LAN with the other NIC. Once you set up the IP addresses/DHCP configuration on both NICs, the system will be able to access both the WAN and the LAN, and systems on the LAN can see and access your laptop.

But the LAN cannot automatically "get to" the Internet through this system with two NICs - you need a router (and likely DHCP server) if you want the LAN to access the Internet, or you need to turn this system with two NICs into a router.

If this system is a Windows system, enabling Internet Connection Sharing will take care of that - it pretty much turns your system into a router and enables a built-in DHCP server. Under Linux, you are likely looking into setting up IP forwarding/NAT manually with iptables, and installing/configuring a DHCP server, and possibly the same for a Mac.

I don't know much about router, can I use a HUB instead to work it out?

No. Hubs/switches are used to create a LAN and make it so a number of machines can talk to each other, but if you want traffic to get to a different network (the Internet "counts" as a "different network"), then you have to have a router in the mix.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .