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
Nusrat NuriyevAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Zephyr ICTCloud ArchitectCommented:
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 "
0
savoneCommented:
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
0
Nusrat NuriyevAuthor Commented:
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.
0
Learn Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

Zephyr ICTCloud ArchitectCommented:
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
0
Nusrat NuriyevAuthor Commented:
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
0
Zephyr ICTCloud ArchitectCommented:
Forget about the command, you tried that already anyway ...

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

Let's me send you text file
0
Nusrat NuriyevAuthor Commented:
I hope this file is not empty))))
ifcfg-em1
0
Zephyr ICTCloud ArchitectCommented:
Ok,

Set
IPV6INIT=no

Set
onboot=yes

Try with the gateway= removed for now ... Save the file and reboot ... Let me know the results.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Nusrat NuriyevAuthor Commented:
works, thanks)
0
Zephyr ICTCloud ArchitectCommented:
No prob ... Thanks for sticking with it :)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux Distributions

From novice to tech pro — start learning today.