Is VyOs able to force all traffic to physical port?



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 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.

Thanks for any reply/explanation!


Can you put this into context?


[quote=“microlinux, post:2, topic:515”][php][/php]
Can you put this into context?

I have eth0 as and eth1 as 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 was asking in my above situation, is vyos able to send packets onto the real Ethernet cable?



Do the packets need to to be exclusively transmitted on physical port?


What do you mean by “exclusively”? Can you please explain a bit. Thanks!


Do you want the packets to only be transmitted on the physical port, or also transmitted on the physical port.


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 to physical port eth0
  2. assign to physical port eth1
  3. create a virtual ip from eth0, let’s call eth0:0
  4. create a virtual ip 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 (using) device eth0
  7. create state route with : destination network (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 tcp port
  11. client_app create a tcp client socket using 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.



Can I ask why you need to do this? It may help come up with a solution.