Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connecting interface of xrv9k instance with the external world #334

Open
ACodingfreak opened this issue Oct 15, 2023 · 3 comments
Open

Connecting interface of xrv9k instance with the external world #334

ACodingfreak opened this issue Oct 15, 2023 · 3 comments

Comments

@ACodingfreak
Copy link

Hi All,

I am new to vrnetlab and I really had fun deploying the initial setup with xrv9k instances.

Is it possible to connect the interfaces on XRV9K instance with the external world via physical interfaces in the server ?

@plajjan
Copy link
Collaborator

plajjan commented Oct 16, 2023

Yes, vr-xcon has a tap mode which can bridge from its "native form", which is the qemu style TCP sockets, to a tap device. Use such a vr-xcon instance on the host machine. Bridge the tap interface to a bridge which also connects to the physical interface. Use your normal vr-xcon instance to connect to this vr-xcon instance and connect it to whatever virtual router you want. It probably means that both vr-xcon needs to run in the host network namespace.

@ACodingfreak
Copy link
Author

Thanks for the reply @plajjan

Can you share a sample command for the same ?

@plajjan
Copy link
Collaborator

plajjan commented Oct 18, 2023

vr-bgp runs xcon in tap mode, see https://github.com/vrnetlab/vrnetlab/blob/master/vr-bgp/vr-bgp.py#L173

So ./xcon.py --tap-listen 1 will listen on port 10001, which is what vrnetlab considers the logical port 1. It will bind to the first tap interface, so tap0. Then create a bridge using brctl and add tap0 and your physical interface into the bridge.

Since xcon is running on localhost, now you need your other vr-xcon instance, the "normal one" and connect your virtual router to localhost, like so vr-xcon.py --p2p my-router/1--localhost/1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants