Windows 7 Forums

Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Static Routes - Create or Remove

14 May 2014   #10
arisandy

Windows 7 64 bit
 
 
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 System SpecsSystem Spec
.
14 May 2014   #11
Shadowjk

Windows 7 Professional x64 SP1 ; Windows Server 2012 R2 Standard
 
 

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 System SpecsSystem Spec
15 May 2014   #12
arisandy

Windows 7 64 bit
 
 
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 System SpecsSystem Spec
15 May 2014   #13
arisandy

Windows 7 64 bit
 
 

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 System SpecsSystem Spec
.

15 May 2014   #14
Kaktussoft

Microsoft Community Contributor Award Recipient

Microsoft Windows 7 Home Premium 64-bits 7601 Multiprocessor Free Service Pack 1
 
 

Quote   Quote: Originally Posted by arisandy View Post
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 System SpecsSystem Spec
15 May 2014   #15
arisandy

Windows 7 64 bit
 
 

route back? im sorry what dou you mean?
My System SpecsSystem Spec
15 May 2014   #16
arisandy

Windows 7 64 bit
 
 

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 System SpecsSystem Spec
15 May 2014   #17
Kaktussoft

Microsoft Community Contributor Award Recipient

Microsoft Windows 7 Home Premium 64-bits 7601 Multiprocessor Free Service Pack 1
 
 

Quote   Quote: Originally Posted by arisandy View Post
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 System SpecsSystem Spec
15 May 2014   #18
arisandy

Windows 7 64 bit
 
 

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 System SpecsSystem Spec
18 May 2014   #19
Shadowjk

Windows 7 Professional x64 SP1 ; Windows Server 2012 R2 Standard
 
 

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   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
My System SpecsSystem Spec
Comment

 Static Routes - Create or Remove




Tutorial Tools Search this Tutorial
Search this Tutorial:

Advanced Search




Similar help and support threads
Windows 7 Tutorial Category
Configuring Static Routes
Hello and thank you for taking the time to read this post. Here is my situation: Physical server configured with one NIC card. IP address is: 192.168.1.136 Physical server is acting as the domain controller and running DNS services. Physical server is running Windows Server 2012 and...
Network & Sharing
Please help: Unable to remove or create Homegroups Win 7
I hope someone can help me: Unable to remove or create a Homegroup on Win 7. I incorrectly set up laptop machine to have a homegroup. Not sure what happened but my desk top computer became attached to this group maybe I inadvertently set this function,,, I attempted to remove the homegroup...
Network & Sharing
Login routes me to temporary profile
I was runnning into some external problems today with internet (a site that was getting overloaded all the time), so I decided to restart my laptop because internet was starting to lag alltogether When I rebooted, I went to enter my password, and it sent me straight to a temporary profile. I can...
General Discussion
Changing routes not working in Win7, but do in WinXP
I have a Windows 7 RC 7100 and have a problem with changing routes on it here at work. We have 3 gateways 10.1.1.1 - default gateway via DHCP for internet browsing 10.1.1.2 - Backup 10.1.1.3 - highspeed for site-to-site connections (not real addresses) When I do the command;
Network & Sharing
Upgrade Routes
Hi everyone! Just a little one really... I've got a 3 month old from DELL, the 'FREE' upgrade is on the way, but I have a copy of W7 from MSDNAA, but when I installed it there was almost zero support for my drivers... DELL has promised a resource CD that will contain the necessary drivers, but...
Installation & Setup
How can you create both a static and dynamic network?
I am trying to create both a static and dynamic network for my computer to choose from when I connect my notebook to one of two locations. I want to create a LAN 1 which picks up the static info specific and an LAN 2 for my dynamic connection. This is possible to do with operating systems such as...
Network & Sharing


Our Sites

Site Links

About Us

Find 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 05:09.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App