LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS
User Name
Password
CentOS This forum is for the discussion of CentOS Linux. Note: This forum does not have any official participation.

Notices


Reply
  Search this Thread
Old 01-05-2015, 02:44 AM   #1
circus78
Member
 
Registered: Dec 2011
Posts: 273

Rep: Reputation: Disabled
Question about metric (ethernet interface config)


Hi,

I have two NIC on this server. For example:

Code:
eth0: 1.1.1.1
eth1: 1.1.1.2
I have two separated config file in /etc/sysconfig/network-scripts, I mean ifcfg-eth0 and ifcfg-eth1.
The problem is that when I browse internet from this machine, traffic is originated by eth1 address (1.1.1.2).
I would like that primary address is 1.1.1.1.
I tried to manage that through "METRIC" parameter

Code:
# cat ifcfg-eth0
DEVICE=eth0
BOOTPROTO=static
ONBOOT=yes
IPADDR=1.1.1.1
NETMASK=255.255.255.0
ONBOOT=yes

METRIC=0

# cat ifcfg-eth1
DEVICE=eth1
BOOTPROTO=static
IPADDR=1.1.1.2
NETMASK=255.255.255.0
ONBOOT=yes
METRIC=1
but preferred route is still on eth1:
Code:
# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         1.1.1.254       0.0.0.0         UG    1      0        0 eth1
I can surely use iptables MASQUERADE to do this, but I'am looking for a clean solution

Can you help me?
 
Old 01-07-2015, 07:18 AM   #2
dijetlo
Senior Member
 
Registered: Jan 2009
Location: RHELtopia....
Distribution: Solaris 11.2/Slackware/RHEL/
Posts: 1,491
Blog Entries: 2

Rep: Reputation: Disabled
What your describing sounds similar to ethernet bonding. Two adapters, 1 session. The difference being with port bonding the result is logically assigned a single adapter designation for administrtion
 
Old 01-12-2015, 11:33 AM   #3
J Martin Rushton
Member
 
Registered: Jan 2015
Location: England
Distribution: Mainly CentOS
Posts: 31

Rep: Reputation: Disabled
I have several machines with multiple interfaces, but they are on separate networks. I prefer traffic between machines to pass over a private network, keeping the public one for external traffic. The parameters for the ifcfg-eth? file are:

DEFROUTE=yes
IPV6_DEFROUTE=yes

You'll need to experiment in your particular case.
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
two LAN connections to same server or interface metric ... how to sorcerer25 Linux - Networking 3 07-06-2011 01:46 AM
can metric prioritize between two Ethernet lan ? Joydeep Bakshi Linux - Networking 3 06-18-2010 12:08 AM
Receive Ethernet VLAN frame on the native ethernet interface (raw packet socket) scottbiker Linux - Networking 0 07-13-2009 03:49 AM
Metric change question hackrat Linux - Networking 2 05-12-2005 04:03 PM
Config shorewall-two-interface question satimis Linux - Networking 0 11-04-2003 10:32 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS

All times are GMT -5. The time now is 12:51 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
Open Source Consulting | Domain Registration