There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
access audio avg avg 8 bios blue screen boot bsod computer connection cpu crash css dell desktop dma driver drivers dvd email error excel explorer firefox firefox 3 freeze gimp graphics hard drive hardware hijackthis hjt install internet internet explorer itunes keyboard laptop macro malware monitor motherboard network networking outlook outlook 2003 outlook 2007 outlook express pio problem problems router seo server slow sound sp3 spyware trojan usb video virtumonde virus vista vundo windows windows vista windows xp winxp wireless
UNIX/Linux
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Operating Systems > UNIX/Linux >
Solved: routing to a cidr network


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

 
Thread Tools
c3v's Avatar
c3v c3v is offline
Junior Member with 7 posts.
 
Join Date: Feb 2006
Experience: Intermediate
28-Feb-2006, 11:39 AM #1
Solved: routing to a cidr network
Hello guys,

I have a debian server which i want to use to connect two networks

Network A: 192.168.1.0/24
Network B: 192.168.50.0/24 - actual

In between my two networks there is a service provider who is going to link them through a WIFI link + VPN.

On my debian i have two NICs

NIC A:
iface eth0 inet static
address 192.168.1.1
netmask 255.255.255.0
network 192.168.1.0


NIC B: - connected to the WIFI gateway
iface eth1 inet static
address 172.16.2.1
netmask 255.255.255.252
network 172.16.2.3
up ip route add 192.168.50.0/24 via 172.16.2.2
pre-down ip route del 192.168.50.0/24 via 172.16.2.2

On my second network the computers are using 192.168.50.20 as the gateway to get access to my first LAN - 192.168.1.0/24

Everything is working fine.. but i would like to use a cidr network on my second LAN since i have only 3 computers over there

therefore instead of using 192.168.50.0/24 i would like to use 192.168.50.50/29 giving me a posibility of having 6 IPs on my second LAN from 192.168.50.49 to 192.168.50.54. But the issue is i do not know how to make the routings...

ip route 192.168.50.50/29 via 172.16.2.2 is giving me RTNETLINK answers: Invalid argument

ip route 192.168.50.0/29 via 172.16.2.2 work fine.. but i will not be able to use 192.168.50.50 as my gateway on the second LAN.

Can someone help me?

Maybe i missed something
dpak's Avatar
Member with 37 posts.
 
Join Date: Jul 2005
Experience: This one time at band camp...
28-Feb-2006, 12:30 PM #2
Hmm... could be because you need to specify the network address for that IP block... so instead of:

ip route 192.168.50.50/29 via 172.16.2.2

Try:

ip route 192.168.50.48/29 via 172.16.2.2

The block you are trying to use is actually 192.168.50.49 -> 192.168.50.54, with a network address of 192.168.50.48 and a broadcast address of 192.168.50.55.

Hope that helps.
__________________
Keep the internet virus free and protect your computer by downloading free antivirus software for your home computer. Changing domains? Try Alter-Ego Profile Migration System.

- DPAK
c3v's Avatar
c3v c3v is offline
Junior Member with 7 posts.
 
Join Date: Feb 2006
Experience: Intermediate
28-Feb-2006, 02:10 PM #3
thanks.. ip route add 192.168.50.48/29 via 172.16.2.2 is correct since .48 is the network address
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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 Off
Refbacks are Off

You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 12:38 AM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.