need help on route command (adding)


 
Thread Tools Search this Thread
Special Forums IP Networking need help on route command (adding)
# 1  
Old 12-04-2007
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

Smilie
# 2  
Old 12-04-2007
try something like this
route add -net 1.1.1.0/24 gw 1.1.1.1
# 3  
Old 12-04-2007
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
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

problem with command 'route -q' in AIX 5.3

Hi all! I have a problem.I access to AIX server via SSH,then i use command 'route -q', after that i can't connect to AIX server.Please help me to fix this problem. Thanks & Best Regards (1 Reply)
Discussion started by: bachtq
1 Replies

2. Red Hat

How to route multiple IP addresses with IPTABLE command?

Hi, We have a router and devices for testing. We route devices with below command iptables -t nat -A PREROUTING -p tcp -d 0/0 --dport 80 -s 10.111.111.22 -j DNAT --to-destination 10.13.0.16:3128 where 10.111.111.22 is device IP. and 10.13.0.16 is our Linux box machine. Likewise we... (4 Replies)
Discussion started by: Dhruvak
4 Replies

3. Solaris

Error adding static route

Hi all i have a simple question here I'm kind of newbie on solaris development currently i'm trying to add static route to solaris environment and i got error, each time i add this static route to it btw this is my command : root@xxxxxx # ping 1.2.3.1 1.2.3.1 is alive echo ... (15 Replies)
Discussion started by: l33tbot_if
15 Replies

4. Solaris

Network interface down after adding static route

Please , I have a problem I have add a statis route on Solaris 10, but after this, the network interface of Server was Offline. The system is in cluster mode (3.2) route add -net 10.10.1.128 -netmask 255.255.255.128 10.10.1.51 ------------------- lo0:... (1 Reply)
Discussion started by: Ruggero
1 Replies

5. Solaris

Adding new Route

Hi, I am trying to add route command in SunOS machine but it is not successful : route add -host 10.31.251.47 -gateway 10.31.251.0 -interface ce0 this command fails with an error "lo0:1: bad value" I want to add a route to 10.31.251.47 that picks 10.31.251.0 as the gateway via the... (1 Reply)
Discussion started by: jaygamini
1 Replies

6. IP Networking

Adding an extra route to the ip routing table

In my college dorm, there is a file sharing network in the entire building. Problem is, there is only a manual for windows with the settings on how to connect... :mad: They say that you have to give the following command in cmd in windows: route add 172.16.71.0 mask 255.255.255.0... (2 Replies)
Discussion started by: Japie89
2 Replies

7. IP Networking

Adding Route in AIX

I need some help in adding a route for a new AIX RS6000 server. I have copied and pasted the route information from an existing server. The IP address of the server listed below is 192.168.100.1 The IP address of the server being added is 192.168.100.88 Routing tables ... (1 Reply)
Discussion started by: Docboyeee
1 Replies

8. UNIX for Dummies Questions & Answers

Route Adding

I am trying to add a route for an interface on my unix server. The interface is qfe0. How do I type out the route add command. The Normal way is route add 1.1.1.0 1.1.1.1 When I want it to bind to a certain interface how to I enter the command. (1 Reply)
Discussion started by: Hordak
1 Replies

9. UNIX for Dummies Questions & Answers

trace route command

very new to unix whats the trace route command (7 Replies)
Discussion started by: jhale123
7 Replies

10. IP Networking

route table command

Im very new to unix.. I want to view the route table whats the command. (1 Reply)
Discussion started by: jhale123
1 Replies
Login or Register to Ask a Question