Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Situation:

               | access point | wi-fi     |   my machine |           | 2-nd machine |
               |  192.168.1.1 | --------- | 192.168.1.37 | Ethernet  |              |
Internet ----  | 76.77.15.87  |           |  192.168.0.1 | --------- | 192.168.0.2  |

I have 2 computers:

The 1-st is connected to the Internet through wi-fi interface. Network: 192.168.1.0/24 default gateway: 192.168.1.1 (IP of the wi-fi access point). It works.

Now I have another machine, connected to mine through the Ethernet interface. Here I have a second network with 2 machines: 192.168.0.0/24:

  1. mine 192.168.0.1
  2. other machine: 192.168.0.2 default gateway 192.168.0.1

ping between the machines works. ping google.com on the 2-nd machine doesn't work.

Now I need to setup the route between the internal and external networks on my machine.

I don't know, what default gateway should I setup on 192.168.0.1 machine for 192.168.0.0 network, because my machine is the default gateway for this network. I tried

route add 192.168.0.0 mask 255.255.255.0 192.168.1.1

but it doesn't work.

IPv4 routing table
===========================================================================
Active routes:
Network address       Network mask     Default gateway     Interface  Metrics
          0.0.0.0          0.0.0.0         On-link       192.168.0.1    276
          0.0.0.0          0.0.0.0      192.168.1.1     192.168.1.37     25
          0.0.0.0          0.0.0.0     192.168.1.37      192.168.0.1    276
        127.0.0.0        255.0.0.0         On-link         127.0.0.1    306
        127.0.0.1  255.255.255.255         On-link         127.0.0.1    306
  127.255.255.255  255.255.255.255         On-link         127.0.0.1    306
      192.168.0.0    255.255.255.0         On-link       192.168.0.1    276
      192.168.0.1  255.255.255.255         On-link       192.168.0.1    276
    192.168.0.255  255.255.255.255         On-link       192.168.0.1    276
      192.168.1.0    255.255.255.0         On-link      192.168.1.37    281
     192.168.1.37  255.255.255.255         On-link      192.168.1.37    281
    192.168.1.255  255.255.255.255         On-link      192.168.1.37    281
        224.0.0.0        240.0.0.0         On-link         127.0.0.1    306
        224.0.0.0        240.0.0.0         On-link       192.168.0.1    276
        224.0.0.0        240.0.0.0         On-link      192.168.1.37    281
  255.255.255.255  255.255.255.255         On-link         127.0.0.1    306
  255.255.255.255  255.255.255.255         On-link       192.168.0.1    276
  255.255.255.255  255.255.255.255         On-link      192.168.1.37    281
===========================================================================
share|improve this question

migrated from serverfault.com Jul 7 at 11:54

This question came from our site for professional system and network administrators.

1  

1 Answer 1

up vote 2 down vote accepted

Your route statement isn't what you want. The 192.168.1.1 router isn't the gateway for the 192.168.0.0/24 network (which is what your route statement says-- it's flat wrong).

You'll want to place a route on the 192.168.1.1 wireless router to give it a route to the 192.168.0.0/24 network via the 192.168.1.37 PC.

You'll also need to enable IP routing on the Windows 7 PC to get it to forward packets.

share|improve this answer
    
I enabled IP routing and rebooted the machine. Also I set 192.168.1.37 as a default gateway for 192.168.0.1 interface. But it still doesn't work. I added the current routing table to my question. –  user4035 Jul 7 at 7:50
    
ok I solved it by adding a route 192.168.0.0/24 to 192.168.1.37 on the access point, only now understood what you meant –  user4035 Jul 7 at 9:49

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.