Sponsored Content
Special Forums IP Networking need help on route command (adding) Post 302148957 by ko9ko9ko9 on Tuesday 4th of December 2007 10:59:41 AM
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
 

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. 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

7. 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

8. 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

9. 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

10. 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
Mojolicious::Routes(3pm)				User Contributed Perl Documentation				  Mojolicious::Routes(3pm)

NAME
Mojolicious::Routes - Always find your destination with routes SYNOPSIS
use Mojolicious::Routes; # New routes tree my $r = Mojolicious::Routes->new; # Normal route matching "/articles" with parameters "controller" and # "action" $r->route('/articles')->to(controller => 'article', action => 'list'); # Route with a placeholder matching everything but "/" and "." $r->route('/:controller')->to(action => 'list'); # Route with a placeholder and regex constraint $r->route('/articles/:id', id => qr/d+/) ->to(controller => 'article', action => 'view'); # Route with an optional parameter "year" $r->route('/archive/:year') ->to(controller => 'archive', action => 'list', year => undef); # Nested route for two actions sharing the same "controller" parameter my $books = $r->route('/books/:id')->to(controller => 'book'); $books->route('/edit')->to(action => 'edit'); $books->route('/delete')->to(action => 'delete'); # Bridges can be used to chain multiple routes $r->bridge->to(controller => 'foo', action =>'auth') ->route('/blog')->to(action => 'list'); # Simplified Mojolicious::Lite style route generation is also possible $r->get('/')->to(controller => 'blog', action => 'welcome'); my $blog = $r->under('/blog'); $blog->post('/list')->to('blog#list'); $blog->get(sub { shift->render(text => 'Go away!') }); DESCRIPTION
Mojolicious::Routes is the core of the Mojolicious web framework. See Mojolicious::Guides::Routing for more. ATTRIBUTES
Mojolicious::Routes inherits all attributes from Mojolicious::Routes::Route and implements the following new ones. "base_classes" my $classes = $r->base_classes; $r = $r->base_classes(['MyApp::Controller']); Base classes used to identify controllers, defaults to Mojolicious::Controller and Mojo. "cache" my $cache = $r->cache; $r = $r->cache(Mojo::Cache->new); Routing cache, defaults to a Mojo::Cache object. # Disable caching $r->cache(0); "conditions" my $conditions = $r->conditions; $r = $r->conditions({foo => sub {...}}); Contains all available conditions. "hidden" my $hidden = $r->hidden; $r = $r->hidden([qw(attr has new)]); Controller methods and attributes that are hidden from routes, defaults to "attr", "has" and "new". "namespace" my $namespace = $r->namespace; $r = $r->namespace('Foo::Bar::Controller'); Namespace used by "dispatch" to search for controllers. "shortcuts" my $shortcuts = $r->shortcuts; $r = $r->shortcuts({foo => sub {...}}); Contains all available shortcuts. METHODS
Mojolicious::Routes inherits all methods from Mojolicious::Routes::Route and implements the following ones. "add_condition" $r = $r->add_condition(foo => sub {...}); Add a new condition. "add_shortcut" $r = $r->add_shortcut(foo => sub {...}); Add a new shortcut. "auto_render" $r->auto_render(Mojolicious::Controller->new); Automatic rendering. "dispatch" my $success = $r->dispatch(Mojolicious::Controller->new); Match routes with Mojolicious::Routes::Match and dispatch. "hide" $r = $r->hide(qw(foo bar)); Hide controller methods and attributes from routes. "route" my $route = $r->route; my $route = $r->route('/:action'); my $route = $r->route('/:action', action => qr/w+/); my $route = $r->route(format => 0); Generate route matching all HTTP request methods. SEE ALSO
Mojolicious, Mojolicious::Guides, <http://mojolicio.us>. perl v5.14.2 2012-09-05 Mojolicious::Routes(3pm)
All times are GMT -4. The time now is 03:44 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy