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
  • 5
  • 2

Expert Comment

Comment Utility
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

Comment Utility
#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

Comment Utility
BTW is a typo in my last post evertyhing should be relative to the network
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.


Author Comment

Comment Utility
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

Comment Utility
I guess I have left out a major point here this is a ROUTER

Accepted Solution

Alf666 earned 500 total points
Comment Utility
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

Comment Utility
Yes perfect!!!

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
OpenVPN routing 2 43
OpenWrt 1 28
IPA - change main server? 3 86
IPA client Config problems 2 96
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…
Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

762 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now