I am trying to create a dhcp server with
iproute2 and the DHCP part is working fine, yet the clients don't get any internet.
The host is getting internet from 192.168.150.0/25 network and functions as a router/DHCP-server for the subnet 192.168.169.0/24.
The clients will get the ip's from the correct ip address range, when I connect them to the same interface as the host machine.
This is my network config.
# Starting interfaces ip link set dev eth0 up ip link set dev eth1 up # Assigning addresses to interface ip addr add "192.168.150.29/25" dev eth0 brd + ip addr add "192.168.169.1/24" dev eth1 brd + # Specifying how eth0 will get his internet. ip route add default dev eth0 via "192.168.150.1" scope global
My question is how can I route the internet connection from eth0 to eth1 as well.
I was trying to add the route like this:
ip route add "192.168.169.1/24" dev eht0
and similar but it says
wrong prefix when I have
"192.168.169.1" if I change
0 then I get another error that
File exists or
Nexthop has invalid gateway.
Thank you in advance
Also as a note: I don't know if it is important, but both eth0 and eth1 is bridged into the machine which is running on libvirt.