Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 877
  • Last Modified:

Using Route Commands and Aliasing

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 192.226.23.65 netmask 255.255.255.224 broadcast 192.229.23.95

  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.

http://www.die.net/doc/linux/man/man8/route.8.html

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

IfaceIDestinationIGateway IFlagsIRefCntIUseIMetricIMaskIIMTUIWindowIIRTT
eth2IFFFFFFFFI00000000I05I0I0I0IFFFFFFFFI1500I0I0
eth1IFFFFFFFFI00000000I05I0I0I0IFFFFFFFFI1500I0I0
eth2I9859E518I00000000I01I0I81I0IF8FFFFFFI1500I0I0
eth1I2017E518I00000000I01I0I1267I0IE0FFFFFFI1500I0I0
eth0I400DE518I00000000I01I0I2I0IC0FFFFFFI1500I0I0
loI0000007FI00000000I01I0I9I0I000000FFI3584I0I0
eth0I00000000I410DE518I03I0I15878I0I00000000I1500I0I0


NIC configuration.

eth0 (192.226.13.78) <static recieved dhcp>

eth1 (192.226.23.33) <IP pool 1 subnet (255.255.255.224)>
   |-----eth1:1 <IP pool 2 aliased 192.229.23.65 subnet (255.255.255.224)>

eth2 (192.226.89.153)


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

Thank you for your time and consideration.


0
hexfusion
Asked:
hexfusion
  • 5
  • 2
1 Solution
 
Alf666Commented:
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 ?
0
 
hexfusionAuthor Commented:
#ifconfig eth1:1 192.226.23.65 netmask 255.255.255.224 broadcast 192.229.23.95

Created eth1:1 to resolve as 192.226.23.65 works fine

But routing does not work for the IP pool 192.226.23.64 /27 through eth1:1 which has been set as 192.226.23.65.  I can ping the address of eth1:1 but I cannot connect to a computer through eth1:1 in the pool ex.) 192.226.23.67.  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 192.229.23.64 netmask 255.255.255.224 gw 192.229.23.65 dev eth1:1

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

Thanks
0
 
hexfusionAuthor Commented:
BTW 192.229.23.64 is a typo in my last post evertyhing should be relative to the 192.226.23.0 network
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
hexfusionAuthor Commented:
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
0
 
hexfusionAuthor Commented:
I guess I have left out a major point here this is a ROUTER
0
 
Alf666Commented:
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 192.229.23.64 netmask 255.255.255.224 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.
0
 
hexfusionAuthor Commented:
Yes perfect!!!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 5
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now