Hi,
I want to configure a very simple SNAT.
VYOS itself is connected to the Internet.
For example, the following works fine.
$ ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=118 time=1.20 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=118 time=1.21ms
However, I am unable to connect to the internet via SNAT from the PC running VYOS.
i.e., from client PC: ping 8.8.8.8 fails
Could you please offer your advice on this issue?
$ show version
Version: VyOS 1.5-stream-2025-Q1
Release train: circinus
Release flavor: generic
Built by: VyOS Networks Iberia S.L.U.
Built on: Thu 13 Feb 2025 18:06 UTC
Build UUID: b38b28e0-a516-4f56-a596-5502ae094d3b
Build commit ID: 5128f5e45cdb73-dirty
$ show configuration
interfaces {
ethernet eth0 {
address 133.130.98.92/23
description Internet
duplex auto
speed auto
}
ethernet eth1 {
address 192.168.0.1/24
description Private-network
duplex auto
speed auto
}
loopback lo {
}
}
nat {
source {
rule 10 {
outbound-interface {
name eth0
}
source {
address 192.168.0.0/24
}
translation {
address masquerade
}
}
}
}
protocols {
static {
route 0.0.0.0/0 {
next-hop 133.130.98.1 {
}
}
}
}
$ show interface
Codes: S - State, L - Link, u - Up, D - Down, A - Admin Down
Interface IP Address MAC VRF MTU S/L Description
----------- ---------------- ----------------- ------- ----- ----- ---------------
eth0 133.130.98.92/23 02:01:85:82:62:5c default 1500 u/u Internet
eth1 192.168.0.1/24 fa:16:3e:3b:88:f8 default 1500 u/u Private-network
lo 127.0.0.1/8 00:00:00:00:00:00 default 65536 u/u
$ show nat source rules
Rule Source Destination Proto Out-Int Translation
------ -------------- ------------- ------- --------- -------------
10 192.168.0.0/24 0.0.0.0/0 IP eth0 masquerade
sport any dport any
$ show ip route
Codes: K - kernel route, C - connected, S - static, R - RIP,
O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
T - Table, v - VNC, V - VNC-Direct, A - Babel, F - PBR,
f - OpenFabric,
> - selected route, * - FIB route, q - queued, r - rejected, b - backup
t - trapped, o - offload failure
S>* 0.0.0.0/0 [1/0] via 133.130.98.1, eth0, weight 1, 00:23:05
C>* 133.130.98.0/23 is directly connected, eth0, 00:23:08
C>* 192.168.0.0/24 is directly connected, eth1, 00:21:07