LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 11-17-2015, 10:20 AM   #1
UNIX Zyklon
LQ Newbie
 
Registered: Jan 2010
Posts: 17

Rep: Reputation: 1
CentOS 6.7 Eth0 doesn't work unless ifdown/ifup


I have a virtual KVM server with two virtual interfaces, eth0 and eth1

both have a similar ifcfg-ethX file with the onboot=yes, and the only change beeing the ip and gateway addresses

however when I reboot the server or do a service network restart, eth0 won't work, it will still show the IP address when I list it but it wont work unless i do a ifdown/ifup on it

what could be causing this issue?

i tried deleting the virtual nic and add a new one with a new MAC, the problem still same

DEVICE=eth0
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=none
IPADDR=10.0.55.31
PREFIX=24
GATEWAY=10.0.55.254
DNS1=10.0.5.1
DNS2=10.0.5.2
DOMAIN=mydomain.com
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME=eth0
 
Old 11-17-2015, 07:02 PM   #2
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Do you define GATEWAY in both ifcfg files? This might confuse setup code, not sure.
DEFROUTE is, as far as I know, only used in ppp config files, but perhaps it also confuses the network setup.

After rebooting, show us:
  • output of ip a
  • output of ip r
  • both ifcfg files
  • whatever command you use to test eth0
then the same again after ifdown/up.
 
Old 11-18-2015, 04:10 AM   #3
UNIX Zyklon
LQ Newbie
 
Registered: Jan 2010
Posts: 17

Original Poster
Rep: Reputation: 1
thank you,

the problem was indeed in the config files having a default gateway, i removed the gateway from eth1 and it now works

now my next question, what would be the best way to add a route to the gateway i removed? create rules and add on /etc/rc.local or use iptables?
either way im no sure how to get done...
 
Old 11-18-2015, 05:35 AM   #4
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Quote:
Originally Posted by UNIX Zyklon View Post
thank you,

the problem was indeed in the config files having a default gateway, i removed the gateway from eth1 and it now works

now my next question, what would be the best way to add a route to the gateway i removed? create rules and add on /etc/rc.local or use iptables?
either way im no sure how to get done...
I think what you want is static routing. I don't know this by heart, but there are plenty of cookbooks on the internet.
 
  


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
[SOLVED] ifup and ifdown commands don't work. venom4u31 Linux - Newbie 11 11-27-2011 11:50 AM
ifdown eth0 works but doesn't work? vdemuth Linux - Networking 7 12-03-2010 10:37 AM
ifconfig , ifdown, ifup deci007 Linux - Newbie 2 11-13-2009 01:00 AM
IPv6 only works as configured when ifdown/ifup eth0 - not on reboot maxrate Linux - Networking 3 11-02-2009 05:42 PM
ifup/ifdown? redbull Linux - Software 2 04-04-2004 04:30 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 08:27 AM.

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
Open Source Consulting | Domain Registration