• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 190
  • Last Modified:

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
0
Nusrat Nuriyev
Asked:
Nusrat Nuriyev
  • 5
  • 5
1 Solution
 
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
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

 
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
 
Nusrat NuriyevAuthor Commented:
works, thanks)
0
 
Zephyr ICTCloud ArchitectCommented:
No prob ... Thanks for sticking with it :)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

  • 5
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now