Using Route Commands and Aliasing

Posted on 2004-04-01
Last Modified: 2010-03-18
IP's have been changed to protect the innocent.  

  I am using a small floppy based linux disro called freesco v3.0 and I am having a bit of trouble completly understanding how the route command should be used in the situation I have.  We have 3 IP pools assisgned by our ISP (see below) 2 of which are in sequence but are seperate pools.  The router has 3 NICs eth0, eth1, eth2 and due to limitations with the hardware we cannot add another card.  Which would in this case have been an easy way out.  Also the router does not use the NAT or firewall functions of the router.

Step1 (alaising)

#ifconfig eth1:1 netmask broadcast

  So in order to add the third pool I have 1st aliased the gateway ip for the 2nd pool to eth1 calling it eth1:1.  I can ping this ip fine and it works great.  But now i need to add proper routing for this pool and I am having some issues on how I should break the routing between the 2 pools using the route command.  The link below highlights the commands but I am unsure as to the proper usage in this situation.

here is a look at my /proc/net/route but what does this mean?

IfaceIDestinationIGateway IFlagsIRefCntIUseIMetricIMaskIIMTUIWindowIIRTT

NIC configuration.

eth0 ( <static recieved dhcp>

eth1 ( <IP pool 1 subnet (>
   |-----eth1:1 <IP pool 2 aliased subnet (>

eth2 (

So the question I am asking is what route commands should be used to add to eth1:1

Thank you for your time and consideration.

Question by:hexfusion
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 2

Expert Comment

ID: 10731493
I don't understand what you're looking for ?

At the moment you create the alias, it should automatically add a route for outgoing packets thru this interface as it's a directly connected route.

What, practically, can't you do ? What does not work ?

Author Comment

ID: 10731538
#ifconfig eth1:1 netmask broadcast

Created eth1:1 to resolve as works fine

But routing does not work for the IP pool /27 through eth1:1 which has been set as  I can ping the address of eth1:1 but I cannot connect to a computer through eth1:1 in the pool ex.)  So it would seem that although eth1:1 has a static IP it does not understand that it must route traffic for this pool through it.  So I am trying to set routing using the route command.  Below is my hypothesis but as I have never used this command I would like some guidance if possible to my logic.

#route add -net netmask gw dev eth1:1

This would read add network with netmask through gateway on device eth1:1


Author Comment

ID: 10731543
BTW is a typo in my last post evertyhing should be relative to the network
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.


Author Comment

ID: 10731607
Also see how no route for eth1:1 was added

#cat /proc/net/route

Iface   Destination     Gateway         Flags   RefCnt  Use     Metric  Mask   MTU      Window  IRTT
eth2    FFFFFFFF        00000000        05      0       0       0       FFFFFFFF1500    0       0                                                              
eth1    FFFFFFFF        00000000        05      0       0       0       FFFFFFFF1500    0       0                                                              
eth2    9859E518        00000000        01      0       84      0       F8FFFFFF1500    0       0                                                              
eth1    2017E518        00000000        01      0       1327    0       E0FFFFFF1500    0       0                                                              
eth0    400DE518        00000000        01      0       2       0       C0FFFFFF1500    0       0                                                              
lo      0000007F        00000000        01      0       10      0       000000FF3584    0       0                                                              
eth0    00000000        410DE518        03      0       16483   0       000000001500    0       0

Author Comment

ID: 10731621
I guess I have left out a major point here this is a ROUTER

Accepted Solution

Alf666 earned 500 total points
ID: 10731774
Weird. You mean you can't ping one of the boxes on the network from the router ?

Maybe something special with this distrib. Then, you should do :

route add -net netmask dev eth1

No gateway as this is not a gateway, but a directly connected route.
Also, dev is eth1. eth1:1 is just an alias. the real device is in fact eth1.

Author Comment

ID: 10732006
Yes perfect!!!

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
E-mail settings for Fail2ban 7 153
FTP File Transfer Failure 13 188
BIND DNS - Single Zone 2 views 5 84
can't umount nfs share after server goes offline... 4 98
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…
In an interesting question ( here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

726 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