I am currently using GNU/Linux Have the following routing table:
default via 192.168.1.1 dev eno1 proto static metric 100
10.0.0.0/8 dev enp1s0 scope link linkdown
169.254.0.0/16 dev virbr0 scope link metric 1000 linkdown
192.168.1.0/24 dev eno1 proto kernel scope link src 192.168.1.2 metric 100
192.168.122.0/24 dev virbr0 proto kernel scope link src 192.168.122.1 linkdown
I use NIC with eno1 to connect to the internet via gateway on subnet 192.168.1.0/24
I use NIC with enp1s0 to act as a NAT gateway(10.0.0.1
) for my internal subnet(10.0.0.0/8
)
Now I want to add(learning purposes) route to 10.0.0.0/8
subnet via my external(eno1) interface:
# Added route via eno1, resulting in routing table shown above
ip route add 10.0.0.0/8 dev enp1s0
# When I add route via enp1s0, command causes error
ip route add 10.0.0.0/8 dev eno1
RTNETLINK answers: File exists
Could you show please how to solve this problem? Thanks.