I think that you just need to create an L3 vlan subinterface:

 

vpp# create sub-interface <actual-trunk-port> 300

 

At that point, <actual-trunk-port>.300 should be an L3 subinterface which will 
strip vlan tag 300 for RX packets, and add vlan tag 300 for TX packets. Strikes 
me that that’s exactly what you need. 

 

if <actual-trunk-port>=GigabitEthernet3/0/0, setting TRUNK_PORT to 
GigabitEthernet3/0/0.300 and inhaling the rest of the configuration MAY just 
work. I’ve never tested the various NAT flavors, the DNS resolver, etc. to see 
if the code truly works with vlan subinterfaces.

 

Let me know what happens. I’ve never constructed a suitable test topology for 
this use case, so it may take some doing to fix issues.  

 

HTH... Dave

 

 

From: vpp-dev@lists.fd.io <vpp-dev@lists.fd.io> On Behalf Of pepijn de vos
Sent: Sunday, December 25, 2022 11:30 AM
To: vpp-dev@lists.fd.io
Subject: Re: [vpp-dev] Outdated home gateway script for NAT?

 

Hi Dave,

Thanks a lot of the update, I have managed to get it to work now, at least as a 
secondary router behind my ISP router.
My ISP wants the WAN port to use VLAN 300, and I can't figure out how to do 
that.

I've tried to push the vlan tag on the outward port 

set int l2 tag-rewrite $(TRUNK) push dot1q 300

and I tried creating a subinterface and binding nat44 to that 

create sub-interfaces $(TRUNK) 300 default

set int state $(TRUNK).300 up
set interface nat44 in bvi0 out $(TRUNK).300

and tried the reverse on the bvi0 interface.
I might be missing the correct commands by a millimeter or a kilometer, but I'm 
not getting an IP on the WAN.

TBH I did not copy most of the new additions because I had to google what some 
of them even stand for.
Maybe once I got this all set up I should make a PR to add some comments and 
instructions for beginners like me on what some of these commands do and what 
they are for.

Cheers,
Pepijn 

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#22385): https://lists.fd.io/g/vpp-dev/message/22385
Mute This Topic: https://lists.fd.io/mt/95859254/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/leave/1480452/21656/631435203/xyzzy 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to