How to route all incoming packets from one virtual interface?

Hello, I'm trying to route all packets arriving at a particular interface by entering the same interface
the virtual interface eth1: 2 and now everything is routed by default gw configured on eth1.

eth1      Link encap:Ethernet  HWaddr 0a:0e:64:18:52:72
          inet addr:192.168.10.15
eth1:2    Link encap:Ethernet  HWaddr 0a:0e:64:18:52:72
          inet addr:192.168.10.23

default gw

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.10.0    *               255.255.255.0   U     0      0        0 eth1
default         192.168.10.254  0.0.0.0         UG    0      0        0 eth1

I want all incoming packets from 192.168.10.23 going out from the same interface.

Some help?

I assume you're using Linux?

You can make this happen using Linux Policy Routing. I've messed with this when I had two Internet connections and it can be a headache.

Here is a howto I found with Google that explains the steps I think you need: A Quick Introduction to Linux Policy Routing

1 Like