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?