Go Back   Hardware Forums > Software Support Forums > Linux and Other OSes

Reply
 
LinkBack Thread Tools
Old 22-04-2008, 04:25 PM   #1 (permalink) Top
Geek Geek Geek!
 
megamaced's Avatar
 
Join Date: Nov 2005
Age: 24 Male
Posts: 3,467
Times Helpful: 352
My Mood: Fine
Status: Offline

My Computer

Default Adding a static route

Hey guys, I am trying to add a static route (not persistant) using Ubuntu. I am connecting to another network via PPTP that uses the same IP address range as my network. When I connect to a computer that is located on the other network, I need the traffic to go through the VPN gateway, obviously.

In Windows I could just do:

route add <destination computer ip> mask 255.255.255.255 <ppp ip address>

How would that command translate into UNIX speak?

Ta

__________________
"A computer is like air conditioning: it becomes useless when you open windows". ~Linus Torvalds
  Reply With Quote
Whats this? diNovo Edge Bluetooth Wireless Keyboard
diNovo Edge Bluetooth Wireless Keyboard
Seller Price (inc. VAT) Delivery Total Price Availability Seller Rating
Dell £122.96 Free £122.96 In Stock Rated: 0 out of 5 - Number of votes: 0
inkcartridgedirect.org.uk £95.96 £4.99 £100.95 In Stock Rated: 1 out of 5 - Number of votes: 1
Dell Business £104.65 £8.23 £112.88 In Stock Rated: 0 out of 5 - Number of votes:
Old 22-04-2008, 05:50 PM   #2 (permalink) Top
The King

 
Addis's Avatar
 
Join Date: Jan 2004
Age: 18 Male
Posts: 5,255
Times Helpful: 403
My Mood: Drunk
Status: Offline

My Computer

Don't know if this is what you're looking for, but there's a route program in linux anyway. Wtih similar syntax to your example, take a look at that if you haven't already.
__________________
Never trust a program you don't have the source code for.

My website | Powerful Desktop Linux | Linux for human beings | Linux for power users | Linux for ricers
Send a message via MSN to Addis   Reply With Quote
Old 22-04-2008, 08:19 PM   #3 (permalink) Top
Nonconformist Geek
 
Anti-Trend's Avatar
 
Join Date: Oct 2003
Age: 27 Male
Posts: 4,880
Times Helpful: 536
Status: Offline

My Computer

To list routes:
Code:
route -n
You can add a new static route with `route add`. For example, if you have an IP on 192.168.2.0/24 and you wanted a route to 192.168.240.0/24, you could add a static route like so:
Code:
route add -net 192.168.240.0 netmask 255.255.255.0 gw 192.168.2.1
...assuming the router providing the route is 192.168.2.1.
Send a message via ICQ to Anti-Trend Send a message via AIM to Anti-Trend   Reply With Quote
The Following User Says Thank You to Anti-Trend For This Useful Post: Show me >>
Old 23-04-2008, 11:40 AM   #4 (permalink) Top
Geek Geek Geek!
 
megamaced's Avatar
 
Join Date: Nov 2005
Age: 24 Male
Posts: 3,467
Times Helpful: 352
My Mood: Fine
Status: Offline

My Computer

Quote:
Originally Posted by Anti-Trend View Post
Code:
route add -net 192.168.240.0 netmask 255.255.255.0 gw 192.168.2.1
...assuming the router providing the route is 192.168.2.1.
Thanks mate, that works perfectly with a "sudo" at the beginning
__________________
"A computer is like air conditioning: it becomes useless when you open windows". ~Linus Torvalds
  Reply With Quote
Old 24-04-2008, 02:16 AM   #5 (permalink) Top
Nonconformist Geek
 
Anti-Trend's Avatar
 
Join Date: Oct 2003
Age: 27 Male
Posts: 4,880
Times Helpful: 536
Status: Offline

My Computer

Off Topic:

Quote:
Originally Posted by megamaced View Post
Thanks mate, that works perfectly with a "sudo" at the beginning
Every time an Ubuntu user runs the `sudo` command, a naked molerat is conceived.
Send a message via ICQ to Anti-Trend Send a message via AIM to Anti-Trend   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
use of static.... Dambuster General Hardware 6 17-02-2007 12:24 AM
Anti Static ??? thhancock3 General Hardware 8 21-09-2006 05:47 PM
What is the better route SLI or ATI Crossfire? efx2003 Video Cards, Displays and TV Tuners 7 03-05-2006 07:31 PM
static ip address bulldoggibbo1970 General Software 1 11-05-2005 05:57 PM


All times are GMT +1. The time now is 03:20 PM.


Copyright © 2000 - 2008 · HARDWAREFORUMS.COM · All rights reserved