Is VyOs able to force all traffic to physical port?

Hi community,

I’m re-posting my question to this board looking for answers:

I get to know VyOS 5 min ago. Feel excited about what this project is offering.

As post title indicated, my first question is: is VyOS able to force all the traffic (except to localhost port 127.0.0.1) onto physical port?

For example, if the computer has eth0 and eth1 with mac/ip address of Mac1/IP1 and Mac2/IP2 correspondingly. On regular computer/linux, when I send a packet from eth1 port (using IP1 address) to IP2 address, it’ll be routed internally without the packet going onto the physical eth0/eth1 port. What I want is all the packets/traffic can be sent out onto physical ports no matter it’s internally routed or not.

Take it further:
I have eth0 as 10.10.1.1/24 and eth1 as 10.10.2.2/24 in the same box using static ip. Eth0 and eth1 direct connect back-to-back. On regular linux i.e, centos or debian, if my application create a socket using eth0’s ip as source IP and set destination ip as eth1’s ip address, Linux kernel won’t send the packet off the box. There will be no real packet transmitted over the Ethernet cable.

My question is: whether vyos is able to send packets onto the real Ethernet cable?

Thanks!
James

It does not matter as long as it can be transmitted on the physical port.
It’ll be perfect if it’s configurable.
I understand I’m dealing with application level problem. After some thinking, I realize the problem can be described this way:

  1. assign 10.10.1.1/24 to physical port eth0
  2. assign 10.10.2.2/24 to physical port eth1
  3. create a virtual ip 10.10.1.100 from eth0, let’s call eth0:0
  4. create a virtual ip 10.10.2.200 from eth1, let’s call eth1:0
  5. use physical ethernet cable directly connect physical port eth0 and physical port eth1
  6. create static route with : destination network 10.10.1.0/24 (using) device eth0
  7. create state route with : destination network 10.10.2.0/24 (using) device eth1
  8. i create a client socket application, let’s call it client_app
  9. create a server socket application, let’s call it server_app
  10. server_app listens to 10.10.2.200:xxx tcp port
  11. client_app create a tcp client socket using 10.10.1.100 as the socket’s source ip and yyy as client socket’s port number.
  12. client_app send the packet out
  13. Here comes the problem on the regular linux : the packet will never ride onto the physical ethernet cable — the packet will be internally routed by linux kernel without bothering to do real io operation to network card.
  14. I want the packet go out onto the physical cable. This makes the x86 vyos box behave as a real router. Also since it’s based on debian, I believe I would be able to migrate my application to vyos.

Thanks!
James

I feel like you are trying to bend the rules of linux space time
This sounds like a violation of all that is good and holy about the kernel IP stack
If you want to put traffic on a wire, you need a second box
the vyos box already behaves like any other routing server/appliance, no router in the world would choose to send a packet over a wire when it has a back to back connection in it’s internal routing plane

Please do not cross post. Keep it all to one thread.


http://forum.vyos.net/showthread.php?tid=26080