LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-19-2019, 04:54 PM   #1
tonj
Member
 
Registered: Sep 2008
Posts: 505

Rep: Reputation: 37
centos 7 cannot make permanent default route


every time I boot my centos 7 machine I have no internet and the route table shows this:

Code:
# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
172.16.0.0      0.0.0.0         255.255.0.0     U     100    0        0 enp6s4f0
192.168.122.0   0.0.0.0         255.255.255.0   U     0      0        0 virbr0
Code:
# ip route
172.16.0.0/16 dev enp6s4f0 proto kernel scope link src 172.16.1.121 metric 100
192.168.122.0/24 dev virbr0 proto kernel scope link src 192.168.122.1
There's no gateway.
I can add a default gateway route and the internet comes on but its never permanent.

my /etc/sysconfig/network file contains this:

Code:
# Created by anaconda
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=<server-hostname>
GATEWAY=172.16.1.60
my ethernet port is enp6s4f0 and /etc/sysconfig/network-scripts/ifcfg-enp6s4f0 contains this:

Code:
TYPE=Ethernet
BOOTPROTO=static
DEFROUTE=no
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
NAME=enp6s4f0
UUID=decf761b-5c21-45fa-910c-92eefa2197e7
ONBOOT=yes
HWADDR=00:1e:68:65:0e:f8
DNS1=156.154.70.22
DNS2=156.154.71.22
IPADDR=172.16.1.121
PREFIX=16
GATEWAY=172.16.1.60
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes

I've been trawling google but can't find a way to make this default gateway permanent. nothing works, thanks for any help.
 
Old 07-19-2019, 05:24 PM   #2
tonj
Member
 
Registered: Sep 2008
Posts: 505

Original Poster
Rep: Reputation: 37
solved it.
I was missing DEFROUTE=yes
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Packet going out of wrong interface due to OS adding cache route - OS trying to route through default route msr1981 Linux - Networking 2 10-11-2017 02:58 PM
Packet going out of wrong interface due to OS adding cache route - OS trying to route through default route msr1981 Red Hat 1 10-09-2017 05:45 AM
Quagga default route not showing in kernel default route (netstat -nr) Valkyr1e Linux - Networking 3 08-03-2008 09:20 PM
Permanent Default Route gianh Arch 3 05-07-2006 02:31 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:25 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration