Answer the question
In order to leave comments, you need to log in
VyOS. How to forward external IPs to internal ones in the local network?
Good day to all.
I figured out how to work in VyOS. Configured interfaces, configured the main gateway, configured users. There are no problems with this ..
There is a problem with forwarding everything that comes to several external IPs to how internal they are. At the moment, it is necessary to forward essentially One-to-One. That is, everything coming, for example, to 120.13.123.123, should be forwarded inside to the local address 10.0.100.3.
If closer to the body, then we have the following:
Interface IP Address S/L Description
--------- ---------- --- -----------
eth0 120.13.123.20/24 u/u MAIN-WAN
eth1 10.0.101.2/24 u/u LAN
eth2 120.13.123.123/24 u/u TEST-1-WAN
eth3 120.13.123.124/24 u/u TEST-2-WAN
set nat source rule 10 source address 10.0.100.3
set nat source rule 10 outbound-interface eth1
set nat source rule 10 translation address 120.13.123.123
set nat destination rule 10 inbound-interface eth2
set nat destination rule 10 destination address 120.13.123.123
set nat destination rule 10 translation address 10.0.100.3
Answer the question
In order to leave comments, you need to log in
It clears things up a bit.
There is a problem through which interface VyOs gives a response to ping and so on.
That is, the ping comes where it is needed, let's say on
eth3 120.13.123.124/24 u / u TEST-2-WAN
but the answer goes through another interface in my case it is eth3, and therefore through eth2 120.13.123.123/24 u / u TEST-1- WAN.
VyOs is extremely strange and chooses this interface on its own.
If I disable the eth2 and eth3 network adapters in the VM settings, then VyOS communicates normally via
eth0 120.13.123.20/24 u/u MAIN-WAN
If I enable eth2 and eth3 again in the VM settings, then VyOS selects eth2 on its own.
I just can’t overcome the line that always remains in the routes table:
default via 120.13.123.254 dev eth2 proto zebra
10.0.101.0/24 dev eth1 proto kernel scope link src 10.0.101.2
127.0.0.0/8 dev lo proto kernel scope link src 127.0.0.1
120.13.123.0/24 dev eth2 proto kernel scope link src 120.13.123.123
120.13.123.0/24 dev eth0 proto kernel scope link src 120.13.123.20
120.13.123.0/24 dev eth3 proto kernel scope link src 120.13.123.124
compare, it looks like an error in the interfaces
set nat source rule 10 source address 10.0.100.3
set nat source rule 10 outbound-interface eth2
set nat source rule 10 translation address 120.13.123.123
set nat destination rule 10 inbound-interface eth2
set nat destination rule 10 destination address 120.13.123.123
set nat destination rule 10 translation address 10.0.100.3
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question