mirror of
https://github.com/vyos/vyos-documentation.git
synced 2025-10-26 08:41:46 +01:00
vrf: add NAT example
This commit is contained in:
parent
93c8726ab9
commit
55b1909b03
@ -279,6 +279,42 @@ Configuration
|
|||||||
set vrf name red protocols static route 10.0.0.0/24 interface eth1 vrf 'default'
|
set vrf name red protocols static route 10.0.0.0/24 interface eth1 vrf 'default'
|
||||||
set vrf name red table '2000'
|
set vrf name red table '2000'
|
||||||
|
|
||||||
|
VRF and NAT
|
||||||
|
-----------
|
||||||
|
|
||||||
|
Configuration
|
||||||
|
^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
.. code-block:: none
|
||||||
|
|
||||||
|
set interfaces ethernet eth0 address '172.16.50.12/24'
|
||||||
|
set interfaces ethernet eth0 vrf 'red'
|
||||||
|
|
||||||
|
set interfaces ethernet eth1 address '192.168.130.100/24'
|
||||||
|
set interfaces ethernet eth1 vrf 'blue'
|
||||||
|
|
||||||
|
set nat destination rule 110 description 'NAT ssh- INSIDE'
|
||||||
|
set nat destination rule 110 destination port '2022'
|
||||||
|
set nat destination rule 110 inbound-interface 'eth0'
|
||||||
|
set nat destination rule 110 protocol 'tcp'
|
||||||
|
set nat destination rule 110 translation address '192.168.130.40'
|
||||||
|
|
||||||
|
set nat source rule 100 outbound-interface 'eth0'
|
||||||
|
set nat source rule 100 protocol 'all'
|
||||||
|
set nat source rule 100 source address '192.168.130.0/24'
|
||||||
|
set nat source rule 100 translation address 'masquerade'
|
||||||
|
|
||||||
|
set service ssh vrf 'red'
|
||||||
|
|
||||||
|
set vrf bind-to-all
|
||||||
|
set vrf name blue protocols static route 0.0.0.0/0 next-hop 172.16.50.1 vrf 'red'
|
||||||
|
set vrf name blue protocols static route 172.16.50.0/24 interface eth0 vrf 'red'
|
||||||
|
set vrf name blue table '1010'
|
||||||
|
|
||||||
|
set vrf name red protocols static route 0.0.0.0/0 next-hop 172.16.50.1
|
||||||
|
set vrf name red protocols static route 192.168.130.0/24 interface eth1 vrf 'blue'
|
||||||
|
set vrf name red table '2020'
|
||||||
|
|
||||||
.. _vrf example operation:
|
.. _vrf example operation:
|
||||||
|
|
||||||
Operation
|
Operation
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user