?
Solved

Trouble Creating a Routing Table

Posted on 2006-03-29
8
Medium Priority
?
558 Views
Last Modified: 2012-06-22
Hi,

I am trying to complete an assignment for a class about subnets and routing tables. I am using the terninal shell on my Mac.

I assigned the IP address 192.168.3.1 to en0. (My teacher's instructions were to assign the address to eth0, but apparently my Mac doesn't use that interface).

Next I was told to test various network addresses and netmasks using the route command. I tried for several that should be legal, but got the error msg "illegal option -a".

Here are a couple of combinations I tried that I think should be legal:

network address: 209.220.186.96 subnet 255.255.255.224

network address: 209.220.186.240 subnet 255.255.255.240

I used the follow command to try to add them to the routing table"

route -add -net 209.220.186.96 netmask 255.255.255.224

etc.

Is there anyone that can help me and tell me what I'm doing wrong?


Thanks.


Kara

0
Comment
Question by:kara334
8 Comments
 
LVL 9

Assisted Solution

by:kfullarton
kfullarton earned 1000 total points
ID: 16324152
Try this:

route add -net 209.220.186.96/27 gw <destination_gateway> en0
0
 
LVL 19

Expert Comment

by:Gabriel Orozco
ID: 16324923
ir, if that does not work, use

route add -net 209.220.186.96 netmask 209.220.186.240 gw <destination_gateway> dev en0

problem is, you need an ip address to be your gateway to the new network. maybe it's your default gateway anyways? but you need to tell the route command that ip in order to make it work.
0
 

Author Comment

by:kara334
ID: 16325384
Well, that sounds like it will work. But I don't know my gateway or default gateway. When I do ifconfig, I don't see it. Can you help me figure out my gateway? Thank you.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 19

Expert Comment

by:Gabriel Orozco
ID: 16325539
netstat -nr

or

route -n

should show it to you.
0
 

Author Comment

by:kara334
ID: 16325752
Thank you again. I think I found the default gateway - 192.168.1.1. But obviously I'm doing something else wrong. (see the code below). I made a few typos along the way. But even when I think I typed everything correctly,  I'm still getting an error.


Karas-Computer:~ root# netstat -nr
Routing tables

Internet:
Destination        Gateway            Flags    Refs      Use  Netif Expire
default            192.168.1.1        UGSc        4        5    en0
127                127.0.0.1          UCS         0        0    lo0
127.0.0.1          127.0.0.1          UH         10     1798    lo0
169.254            link#4             UCS         0        0    en0
192.168.1          link#4             UCS         1        0    en0
192.168.1.1        link#4             UHLW        3        0    en0
192.168.1.101      127.0.0.1          UHS         0        0    lo0
192.168.3          link#4             UC          0        0    en0

Internet6:
Destination                             Gateway                         Flags      Netif Expire
::1                                     ::1                             UH          lo0
fe80::%lo0/64                           fe80::1%lo0                     Uc          lo0
fe80::1%lo0                             link#1                          UHL         lo0
fe80::%en0/64                           link#4                          UC          en0
fe80::20d:93ff:fe76:ce28%en0            0:d:93:76:ce:28                 UHL         lo0
ff01::/32                               ::1                             U           lo0
ff02::/32                               ::1                             UC          lo0
ff02::/32                               link#4                          UC          en0
Karas-Computer:~ root# route add -net 209.220.186.96 netmask 255.255.255.96 gw 192.168.3 dev en0
route: bad address: netmask
Karas-Computer:~ root# route add -net 209.220.186.96 netmask 255.255.255.96 gw 192.168.1.1 dev en0
route: bad address: netmask
Karas-Computer:~ root# route add -net 209.220.186.96 netmask 255.255.255.96 gw 192.168.1.1 dev en0
route: bad address: netmask
Karas-Computer:~ root# route add -net 209.220.186.96 netmask 255.255.255.224 gw 192.168.3 dev en0
route: bad address: netmask
Karas-Computer:~ root# route add -net 209.220.186.96 netmask 255.255.255.224 gw 192.168.1.1 dev en0
route: bad address: netmask
Karas-Computer:~ root# route add -net 209.220.186.240 netmask 255.255.255.240 gw192.168.1.1 dev en0
route: bad address: netmask
Karas-Computer:~ root#
Karas-Computer:~ root#
0
 
LVL 1

Expert Comment

by:kalifi
ID: 16326651
Hi kara334,

Why don't you try
route add -net 209.220.186.240/24 gw192.168.1.1 dev en0
just to see if that works and that change 24 to whatever you need.

Hope that will help.

Miro
0
 
LVL 19

Accepted Solution

by:
Gabriel Orozco earned 1000 total points
ID: 16326949
yes. it is saying the "netmask" part is not part of the route package in your Macintosh...

try to use

 route add -net 209.220.186.240/19 gw192.168.1.1 dev en0
0
 

Author Comment

by:kara334
ID: 16423046
I ended up dropping this class and forgot I had a question open. Sorry for the late points.

Kara
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses
Course of the Month8 days, 7 hours left to enroll

616 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question