powershell powershell - 1 month ago 20
Linux Question

Unable to add default root no such device error in linux

I try have access internet so i should add default route to my linux server my ip address is 10.1.1.1 but my default gateway is 20.1.1.1

I tried to add default gateway with

route add default 20.1.1.1
but get
error :


siocaddrt: no such device


I tried to use virtual nic like
eth0:0
to add ip address in range my default gateway where linux permit me to add default gateway but again I get error as same last error.

Answer

I find solution first i add route to another subnet

route add e.f.g.h/32 dev eth0:1

second i add:

route add default gw e.f.g.h

and my problem solved, i hope no one stick in this error .