LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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 06-17-2015, 10:40 AM   #1
jdmmis
Member
 
Registered: Jul 2008
Posts: 32

Rep: Reputation: 0
Trouble with network (ping, route, gateway)


I have a server running CentOS 7 and I connect to it by ssh. SSH takes a little bit to connect compared to the other server I have setup. This server has 2 ethernet ports (1 motherboard and 1 card). I use the card to create a bridge network for Kvm virtual machines and it works fine. There are times I can't ping or if I use the route command it hangs. I think it has to do with the default gateway for the main ethernet port.

Route when having issues

Quote:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 10.1.1.3 0.0.0.0 UG 0 0 0 br0
10.1.1.0 0.0.0.0 255.255.255.0 U 0 0 0 em1
10.1.1.0 0.0.0.0 255.255.255.0 U 0 0 0 br0
link-local 0.0.0.0 255.255.0.0 U 1002 0 0 em1
192.168.122.0 0.0.0.0 255.255.255.0 U 0 0 0 virbr0
then I run sudo route add default gw 10.1.1.3 em1 or sudo route add default gw 10.1.1.3

Quote:
route

Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 10.1.1.3 0.0.0.0 UG 0 0 0 em1
default 10.1.1.3 0.0.0.0 UG 0 0 0 br0
10.1.1.0 0.0.0.0 255.255.255.0 U 0 0 0 em1
10.1.1.0 0.0.0.0 255.255.255.0 U 0 0 0 br0
link-local 0.0.0.0 255.255.0.0 U 1002 0 0 em1
192.168.122.0 0.0.0.0 255.255.255.0 U 0 0 0 virbr0
I have added the default gateway to the /etc/sysconfig/network file, but still have issues.

Quote:
sudo cat /etc/sysconfig/network

# Created by anaconda
GATEWAY=10.1.1.3
Any ideas?

Thanks for the help.

P.S. I know that they should be static ip addresses and I'm working on it, but having to wait on the net admin.

Last edited by jdmmis; 06-17-2015 at 10:41 AM.
 
Old 06-18-2015, 09:47 AM   #2
lazydog
Senior Member
 
Registered: Dec 2003
Location: The Key Stone State
Distribution: CentOS Sabayon and now Gentoo
Posts: 1,249
Blog Entries: 3

Rep: Reputation: 194Reputation: 194
First off you should not have two Default gateways.

Looking at what you have posted above it looks like the machine doesn't know what interface to use you have to clean up your network configuration. You should not be using the same network on both interfaces.
 
Old 06-18-2015, 10:07 AM   #3
jdmmis
Member
 
Registered: Jul 2008
Posts: 32

Original Poster
Rep: Reputation: 0
So would this solve it then?

cat /etc/sysconfig/network

Quote:
# Created by anaconda
GATEWAY=10.1.1.3
GATEWAYDEV=em1
route

Quote:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 10.1.1.3 0.0.0.0 UG 0 0 0 em1
10.1.1.0 0.0.0.0 255.255.255.0 U 0 0 0 em1
10.1.1.0 0.0.0.0 255.255.255.0 U 0 0 0 br0
link-local 0.0.0.0 255.255.0.0 U 1002 0 0 em1
link-local 0.0.0.0 255.255.0.0 U 1004 0 0 br0
192.168.122.0 0.0.0.0 255.255.255.0 U 0 0 0 virbr0

Thanks for the help.
 
Old 06-18-2015, 12:21 PM   #4
lazydog
Senior Member
 
Registered: Dec 2003
Location: The Key Stone State
Distribution: CentOS Sabayon and now Gentoo
Posts: 1,249
Blog Entries: 3

Rep: Reputation: 194Reputation: 194
I think here is your problem;

Quote:
10.1.1.0 0.0.0.0 255.255.255.0 U 0 0 0 em1
10.1.1.0 0.0.0.0 255.255.255.0 U 0 0 0 br0
Both interfaces are routing the same network. Your system doesn't know which interface it should send traffic through.
 
Old 06-18-2015, 01:03 PM   #5
jdmmis
Member
 
Registered: Jul 2008
Posts: 32

Original Poster
Rep: Reputation: 0
Right now or at least what I want is to have em1 dedicated to the main server and then p4p1 is being used for a bridge connection for Kvm virtual machines so br0 for vms. The server has 2 network cards one on the motherboard and one as a network card. Those cables go into a switch.

So what do I need to do to fix it? Sorry network knowledge is lacking, but I need to fix it.

P.S. I don't know if this matters or not, but some of the vms are only access local on the network while others have static ips setup for access outside of the network.

Last edited by jdmmis; 06-18-2015 at 01:07 PM.
 
Old 06-19-2015, 10:59 AM   #6
lazydog
Senior Member
 
Registered: Dec 2003
Location: The Key Stone State
Distribution: CentOS Sabayon and now Gentoo
Posts: 1,249
Blog Entries: 3

Rep: Reputation: 194Reputation: 194
To fix this you will have to move one of the interfaces off the 10.1.1.0 network.
 
Old 06-22-2015, 10:02 AM   #7
jdmmis
Member
 
Registered: Jul 2008
Posts: 32

Original Poster
Rep: Reputation: 0
Sorry, but how do I do that and to what network then? since both of them still need to be accessed from outside the network and be able to access the outside network.
 
Old 06-23-2015, 08:59 AM   #8
lazydog
Senior Member
 
Registered: Dec 2003
Location: The Key Stone State
Distribution: CentOS Sabayon and now Gentoo
Posts: 1,249
Blog Entries: 3

Rep: Reputation: 194Reputation: 194
One thing you could do is split the 10.1.1.0 in to two networks.

10.1.1.0/25 or 255.255.255.128
10.1.1.128/25 or 255.255.255.128

Then place your Vm's on one network and your management on the other.
 
Old 06-23-2015, 10:09 AM   #9
jdmmis
Member
 
Registered: Jul 2008
Posts: 32

Original Poster
Rep: Reputation: 0
@lazydog

Thank you for the help. I will give that a try.
 
  


Reply

Tags
centos7, network



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
Can't ping gateway, even with correct network settings Hugo2009 Red Hat 3 11-20-2018 06:53 AM
Unable to ping gateway & other Linux boxes on same network msessom Linux - Networking 2 01-02-2013 06:05 PM
Having trouble with default route/gateway x2r3x Linux - Networking 4 07-28-2011 05:32 PM
Adding a route to a dedicated network behind network gateway. dtlfwolf Linux - Networking 1 03-23-2011 05:44 PM
Gateway issues - can't ping certain hosts on attached network drgowans Linux - Networking 1 09-24-2003 02:59 AM

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

All times are GMT -5. The time now is 01:40 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