Static Routes - Create or Remove

Page 2 of 4 FirstFirst 1234 LastLast

  1. Posts : 8
    Windows 7 64 bit
       #10

    ask Route


    Please i Have question and long time no answer

    my laptop
    IP = 192.168.1.89
    mask = 255.255.255.0
    gateway = 192.168.1.1
    (manual setting or not DHCP)

    and I have a openvpn client connect with my laptop and have address 10.0.0.10 (its fine).
    and i have a computer with
    IP = 192.168.1.95
    mask = 255.255.255.0
    gateway = 192.168.1.1

    now i need access 10.0.0.1 from 192.168.1.95 computer, cause i dont want too much openvpn client on same network.
    many time i route add -p it cannot be done.
    please help me, i will be appreciate it. thanks a lot
      My Computer


  2. Posts : 2,298
    Windows 7 Professional x64 SP1 ; Windows Server 2012 R2 Standard
    Thread Starter
       #11

    What is the exact command you are trying to enter? In order to reach the 10.0.0.1 address you would need to setup a default gateway and routing would happen on the default gateway. For a VPN solution you would typically have two separate networks joined by an intermediate one. For example:

    192.168.1.0/24 -----------------------------10.0.0.0/24------------------------------------192.168.2.0/24

    Where is the other end of the VPN connection going to?

    Many Thanks,
    Josh :)
      My Computer


  3. Posts : 8
    Windows 7 64 bit
       #12

    Thnks for answer Josh


    how can i setup a default gateway?

    i have vpn server on VPS ip is 10.0.0.1
    and my laptop is connect with server on vps and ip is 10.0.0.10

    so,
    mylaptop My computer
    IP 192.168.1.89 - - - - - - - - - - 192.168.1.95
    VPN 10.0.0.10
    Mask 255.255.255.0 - - - - - - - - - 255.255.255.0
    gw 192.168.1.1 -- - - - - - - - - 192.168.1.1

    i'd set my laptop as a default gateway so like this,
    mylaptop My computer
    IP 192.168.1.89 - - - - - - - - - - 192.168.1.95
    VPN 10.0.0.10
    Mask 255.255.255.0 - - - - - - - - - 255.255.255.0
    gw 192.168.1.1 -- - - - - - - - - 192.168.1.89

    i'd enable ip router, now i can access the internet its fine.
    but i still cannot access 10.0.0.1-10.0.0.254
    i need to access all vpn ip through that gw (192.168.1.89),
    can you help me please?
      My Computer


  4. Posts : 8
    Windows 7 64 bit
       #13

    so i need mylaptop act as router.
    on ubuntu im use ip masquerade with webmin. and im done with that i can access all vpn ip and internet of course.
    on ubuntu is very easy to become default gateway, but in windows???
      My Computer


  5. Posts : 10,796
    Microsoft Windows 7 Home Premium 64-bits 7601 Multiprocessor Free Service Pack 1
       #14

    arisandy said:
    how can i setup a default gateway?

    i have vpn server on VPS ip is 10.0.0.1
    and my laptop is connect with server on vps and ip is 10.0.0.10

    so,
    mylaptop My computer
    IP 192.168.1.89 - - - - - - - - - - 192.168.1.95
    VPN 10.0.0.10
    Mask 255.255.255.0 - - - - - - - - - 255.255.255.0
    gw 192.168.1.1 -- - - - - - - - - 192.168.1.1

    i'd set my laptop as a default gateway so like this,
    mylaptop My computer
    IP 192.168.1.89 - - - - - - - - - - 192.168.1.95
    VPN 10.0.0.10
    Mask 255.255.255.0 - - - - - - - - - 255.255.255.0
    gw 192.168.1.1 -- - - - - - - - - 192.168.1.89

    i'd enable ip router, now i can access the internet its fine.
    but i still cannot access 10.0.0.1-10.0.0.254
    i need to access all vpn ip through that gw (192.168.1.89),
    can you help me please?
    How can 10.0.0.1-10.0.0.254 know the route back?
      My Computer


  6. Posts : 8
    Windows 7 64 bit
       #15

    route back? im sorry what dou you mean?
      My Computer


  7. Posts : 8
    Windows 7 64 bit
       #16

    how can i setup a default gateway?

    i have vpn server on VPS ip is 10.0.0.1
    and my laptop is connect with server on vps and ip is 10.0.0.10

    so,
    mylaptop ------------------------ My computer
    IP 192.168.1.89 - - - - - - - - - - 192.168.1.95
    VPN 10.0.0.10
    Mask 255.255.255.0 - - - - - - - - - 255.255.255.0
    gw 192.168.1.1 -- - - - - - - - - 192.168.1.1

    i'd set my laptop as a default gateway so like this,
    mylaptop ------------------------ My computer
    IP 192.168.1.89 - - - - - - - - - - 192.168.1.95
    VPN 10.0.0.10
    Mask 255.255.255.0 - - - - - - - - - 255.255.255.0
    gw 192.168.1.1 -- - - - - - - - - 192.168.1.89

    i'd enable ip router, now i can access the internet its fine.
    but i still cannot access 10.0.0.1-10.0.0.254
    i need to access all vpn ip through that gw (192.168.1.89) from my computer (192.168.1.95) ,
    can you help me please?
      My Computer


  8. Posts : 10,796
    Microsoft Windows 7 Home Premium 64-bits 7601 Multiprocessor Free Service Pack 1
       #17

    arisandy said:
    route back? im sorry what dou you mean?
    "How can 10.0.0.1-10.0.0.254 know the route back?"

    I mean if you send something to 10.0.0.x .... then 10.0.0.x should send a message back like "packet receied successfully". But how does he know the route to the original sender?
      My Computer


  9. Posts : 8
    Windows 7 64 bit
       #18

    ok ok i know now. the server is not know he came original packet or not. cause im use openvpn.
    so, i make this very simple.
    i have 2 different network on my laptop, so i need another computer connect to my computer to access internet and vpn.
      My Computer


  10. Posts : 2,298
    Windows 7 Professional x64 SP1 ; Windows Server 2012 R2 Standard
    Thread Starter
       #19

    I think I just about understand what is going on....

    On your laptop that you wish to act as the router you would need to set the following commands to enable routing as well as enable NAT so that the route back can be made. If you don't want to use NAT then simply make sure a valid route from 10.0.0.1 knows how to reach your computer on 192.168.1.95.

    Code:
    echo 1 > /proc/sys/net/ipv4/ip_forward
    The above will allow your linux laptop (192.168.1.89) to be able to route traffic between interfaces.

    Code:
    iptables -t nat -A POSTROUTING -o {OUTBOUND INTERFACE} -j MASQUERADE
    The above sets the outbound interface used to reach the VPN connection. Please replace the OUTBOUND interface section with the interface used to reach the VPN connection (10.0.0.10)... eth0, wlan0 .... etc.

    Code:
    iptables -A FORWARD --in-interface {INBOUND INTERFACE} -j ACCEPT
    The next command sets the inbound interface that connects to the same network as your computer. So the interface with an IP address of 192.168.1.89. Please replace the reference INBOUND interface with the relevant interface such as eth0, wlan0 ... etc.

    Then simply set the route of the destination network from your computer side. For example, if you wish to access the the network of 192.168.2.0/24 using the VPN tunnel then you would input the following command onto your main computer:

    Code:
    route add -p 192.168.2.0 mask 255.255.255.0 192.168.1.89
    If you want to access the internet using the VPN connection then you would simply change the default gateway of your main computer to the laptops IP address. For example, you would change the default gateway from 192.168.1.1 to 192.168.1.89. Also, on your main laptop you should change the default gateway to the VPN of 10.0.0.1. This will cause a default route to be added and allow the internet traffic to flow to the VPN server.

       Note
    The VPN server at the other end should have a default route in place in order to appropriately route the traffic otherwise your internet traffic would be dropped there.


    Hopefully this makes sense and helps somewhat

    Josh :)
    Last edited by Shadowjk; 18 May 2014 at 08:17. Reason: IP Address Changes
      My Computer


 
Page 2 of 4 FirstFirst 1234 LastLast

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 10:44.
Find Us