The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Special Forums > IP Networking
Google UNIX.COM
Home Forums Register Rules & FAQ Members List Arcade Search Today's Posts Mark Forums Read


IP Networking Questions involving TCP/IP, Routers, Hubs, Network protocols, etc go here.


Other UNIX.COM Threads You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Adding new Route jaygamini SUN Solaris 1 05-28-2008 01:14 PM
Adding an extra route to the ip routing table Japie89 IP Networking 2 10-18-2007 04:16 PM
Adding Route in AIX Docboyeee IP Networking 1 11-11-2002 11:07 AM
Route Adding Hordak UNIX for Dummies Questions & Answers 1 10-31-2002 06:57 AM
trace route command jhale123 UNIX for Dummies Questions & Answers 7 05-28-2002 05:34 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-04-2007
Registered User
 

Join Date: Dec 2007
Posts: 1
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!Spurl this Post!
need help on route command (adding)

Hi,

I was window OS user and kinda switched to darwin-bash/Mac OS recently, just asking for some help for setting up routes.

When i was using in window XP i can do "route print" and "route add 64.25.55.200 mask 255.255.255.255 188.17.145.178" ,and then when i access 64.25.55.200, it will route through 188.17.145.178 gateway.


So here I am asking how to do similar thing through Mac OS/Darwin-bash terminal? I am asking this because the example for unix i see on the website is like the following:

# route add 192.168.1.100 10.0.0.1
add host 192.168.1.100: gateway 10.0.0.1

so i dont need to give any "mask" like

route add 64.25.55.200 mask 255.255.255.255 188.17.145.178 in windows??


I tried netstat command in unix and did not see the netmask section. I wonder how to display it out.

In windows i typed netstat print , it looks like

Network Destination Netmask Gateway Interface Metric
0.0.0.0 0.0.0.0 192.168.1.1 192.168.1.100 30
127.0.0.0 255.0.0.0 127.0.0.1 127.0.0.1 1


but in unix i typed netstat -nr , it looks like

Destination Gateway Flags Refs Use Netif Expire
default 10.0.0.1 UGS 2 146537336 fxp0
127.0.0.1 127.0.0.1 UH 0 3414961 lo0
10.0.0.1/26 link#1 UC 0 0 fxp0
10.0.0.2 00:02:b3:4c:65:27 UHLW 0 255732 lo0
10.0.0.1 00:02:7d:cc:3d:00 UHLW 1 0 fxp0 1087


how can i display the netmask section? and why Gateway is 00:02:7d:cc:3d:00 ??? isnt gateway should be like ip address format???


i am a bit confused and if any mac professionals plz help me >_< out

Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 12-04-2007
Registered User
 

Join Date: Aug 2007
Posts: 9
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!Spurl this Post!
try something like this
route add -net 1.1.1.0/24 gw 1.1.1.1
Reply With Quote
  #3 (permalink)  
Old 12-04-2007
Registered User
 

Join Date: Aug 2007
Posts: 9
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!Spurl this Post!
err, to have a netmask of 255.255.255.0 if you want a netmask of 255.255.255.255 (single ip) just use
route add 10.10.10.10 gw 11.11.11.11

edit;
another note, to just list routes type only
route

Last edited by sonicx : 12-04-2007 at 11:38 AM. Reason: forgot
Reply With Quote
Google UNIX.COM
Reply



Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -7. The time now is 06:09 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger

Search Engine Optimization by vBSEO 3.1.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102