I used openwrt as a vpn gateway before but not as a router. Today I tried to setup openwrt as a router. PPPoE successfully dialed up and got a public ipv4 ip from isp. Devices got ip from openwrt dhcp server. But none of them can reach internet, I don’t know why. And I tried to ask at openwrt forum, but they haven’t approved my account yet.
Here is the step I’ve done
incus launch images:openwrt/24.10 wan0
incus config device add wan0 eth0 nic nictype=physical parent=enp3s0
incus config device add wan0 eth1 nic nictype=physical parent=eno1
incus config device add wan0 ppp unix-char path=/dev/ppp
eth0 is my lan port, eth1 is my wan port.
incus exec wan0 ash
opkg update
opkg remove dnsmasq
mv /etc/config/dhcp /etc/config/dhcp-old
opkg install nano dnsmasq-full
sed -i 's/procd_add_jail/: \0/g' /etc/init.d/dnsmasq
Removed dnsmasq and installed dnsmasq-full. And restarted wan0.
Here is my /etc/config/network:
config interface 'loopback'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'
option device 'lo'
config interface 'lan'
option proto 'static'
option device 'eth0'
option ipaddr '192.168.0.1'
option netmask '255.255.255.0'
config interface 'wan'
option proto 'pppoe'
option device 'eth1'
option username 'username'
option password 'password'
option ipv6 'auto'
option keepalive '5 5'
Here is my /etc/config/dhcp:
config dnsmasq
option domainneeded '1'
option localise_queries '1'
option rebind_protection '1'
option rebind_localhost '1'
option local '/lan/'
option domain 'lan'
option expandhosts '1'
option cachesize '1000'
option authoritative '1'
option readethers '1'
option leasefile '/tmp/dhcp.leases'
option resolvfile '/tmp/resolv.conf.d/resolv.conf.auto'
option localservice '1'
option ednspacket_max '1232'
option sequential_ip '1'
config dhcp 'lan'
option interface 'lan'
option start '50'
option limit '200'
option leasetime '3h'
config dhcp 'wan'
option interface 'wan'
option ignore '1'
That’s all I have configed.