Link to home
Start Free TrialLog in
Avatar of Nusrat Nuriyev
Nusrat NuriyevFlag for Azerbaijan

asked on

Failing to add default gateway

route add default gw 192.168.0.254

Open in new window

The output is
SIOCADDRT: Network is unreachable.

Network is ok, because it works when I reload it to fedora live.
It does not work only on installed fedora
Avatar of Zephyr ICT
Zephyr ICT
Flag of Belgium image

I assume you're using DHCP?

Is there a global gateway set in /etc/sysconfig/network?

Did you check the network-scripts for the interface, for example " /etc/sysconfig/network-scripts/ifcfg-eth0 " 
Basically open this file and check if settings seem ok...

If I remember correctly you can set a default gateway per interface like this: " default via X.X.X.X dev int " where int is your interface like eth0 for example...

" default via 192.168.0.254 dev eth0 "
Avatar of Steven Vona
Using the route add command will not survive a reboot.  You have to put the default route into a configuration file for it to survive a reboot.

Typically you put the default gateway into your interface configuration file (example; /etc/sysconfig/network-scripts/ifcfg-eth0".

Like so:
GATEWAY=10.0.0.1
Avatar of Nusrat Nuriyev

ASKER

savone, adding GATEWAY=192.168.0.254
does not work.
spravtek,
Basically open this file and check if settings seem ok...
I don't know what does mean all those settings, but still thank you.
Can you take a screenshot or copy what is in this file?

Did you try doing: default via 192.168.0.254 dev eh 0
do not understand, is default an executable name in this command?
default via 192.168.0.254 dev eh 0 

Open in new window

maybe something like this?
route default via 192.168.0.254 dev eh 0 

Open in new window

Please, be more specific.

Sure, here is a screenshot of the file of em1 inteface
snapshot-network.png
Forget about the command, you tried that already anyway ...

The screenshot seems to not be showing something?
)))) wait, it's another issue, which interferred with this issue.
Fedora is so fedora.

Let's me send you text file
I hope this file is not empty))))
ifcfg-em1
ASKER CERTIFIED SOLUTION
Avatar of Zephyr ICT
Zephyr ICT
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
works, thanks)
No prob ... Thanks for sticking with it :)