The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Special Forums > IP Networking
.
google unix.com



IP Networking Learn TCP/IP, Internet Protocol, Routing, Routers, Network protocols in this UNIX and Linux forum.

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

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 12-04-2007
ko9ko9ko9 ko9ko9ko9 is offline
Registered User
  
 

Join Date: Dec 2007
Posts: 1
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

  #2 (permalink)  
Old 12-04-2007
sonicx sonicx is offline
Registered User
  
 

Join Date: Aug 2007
Posts: 9
try something like this
route add -net 1.1.1.0/24 gw 1.1.1.1
  #3 (permalink)  
Old 12-04-2007
sonicx sonicx is offline
Registered User
  
 

Join Date: Aug 2007
Posts: 9
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 03:38 PM.. Reason: forgot
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 09:02 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0