multiple ip addresses on eth0

Issues related to configuring your network
tuurtnt
Posts: 9
Joined: 2011/02/08 10:31:50

Re: multiple ip addresses on eth0

Post by tuurtnt » 2012/04/19 09:55:40

Here you go...

Information for network problems.
[code]
== BEGIN uname -rmi ==
2.6.32-220.13.1.el6.x86_64 x86_64 x86_64
== END uname -rmi ==

== BEGIN rpm -qa \*-release\* ==
epel-release-6-5.noarch
nginx-release-centos-6-0.el6.ngx.noarch
remi-release-6-1.el6.remi.noarch
centos-release-6-2.el6.centos.7.x86_64
centalt-release-6-1.noarch
== END rpm -qa \*-release\* ==

== BEGIN cat /etc/redhat-release ==
CentOS release 6.2 (Final)
== END cat /etc/redhat-release ==

== BEGIN getenforce ==
Disabled
== END getenforce ==

== BEGIN free -m ==
total used free shared buffers cached
Mem: 3831 404 3426 0 28 180
-/+ buffers/cache: 195 3635
Swap: 6015 0 6015
== END free -m ==

== BEGIN lspci -nn ==
00:00.0 Host bridge [0600]: Intel Corporation 440FX - 82441FX PMC [Natoma] [8086:1237] (rev 02)
00:01.0 ISA bridge [0601]: Intel Corporation 82371SB PIIX3 ISA [Natoma/Triton II] [8086:7000]
00:01.1 IDE interface [0101]: Intel Corporation 82371SB PIIX3 IDE [Natoma/Triton II] [8086:7010]
00:01.2 USB controller [0c03]: Intel Corporation 82371SB PIIX3 USB [Natoma/Triton II] [8086:7020] (rev 01)
00:01.3 Bridge [0680]: Intel Corporation 82371AB/EB/MB PIIX4 ACPI [8086:7113] (rev 03)
00:02.0 VGA compatible controller [0300]: Technical Corp. Device [1234:1111]
00:03.0 Ethernet controller [0200]: Red Hat, Inc Virtio network device [1af4:1000]
00:04.0 Multimedia audio controller [0401]: Ensoniq ES1370 [AudioPCI] [1274:5000]
00:05.0 SCSI storage controller [0100]: Red Hat, Inc Virtio block device [1af4:1001]
00:06.0 RAM memory [0500]: Red Hat, Inc Virtio memory balloon [1af4:1002]
== END lspci -nn ==

== BEGIN lsusb ==
./getinfo.sh: line 89: lsusb: command not found
== END lsusb ==

== BEGIN rpm -qa kmod\* kmdl\* ==
== END rpm -qa kmod\* kmdl\* ==

== BEGIN ifconfig -a ==
eth0 Link encap:Ethernet HWaddr 52:54:00:33:9E:D9
inet addr:141.138.136.xx Bcast:141.138.136.255 Mask:255.255.255.0
inet6 addr: fe80::5054:ff:fe33:9ed9/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:114480 errors:0 dropped:0 overruns:0 frame:0
TX packets:19805 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:26521971 (25.2 MiB) TX bytes:5544610 (5.2 MiB)

eth0:0 Link encap:Ethernet HWaddr 52:54:00:33:9E:D9
inet addr:141.138.141.xxx Bcast:141.138.141.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:3082 errors:0 dropped:0 overruns:0 frame:0
TX packets:3082 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1863905 (1.7 MiB) TX bytes:1863905 (1.7 MiB)

== END ifconfig -a ==

== BEGIN brctl show ==
bridge name bridge id STP enabled interfaces
== END brctl show ==

== BEGIN route -n ==
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
141.138.141.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
141.138.136.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 1002 0 0 eth0
0.0.0.0 141.138.141.1 0.0.0.0 UG 0 0 0 eth0
0.0.0.0 141.138.136.1 0.0.0.0 UG 0 0 0 eth0
== END route -n ==

== BEGIN cat /etc/resolv.conf ==
; generated by /sbin/dhclient-script
nameserver 80.69.67.66
nameserver 80.69.66.67
== END cat /etc/resolv.conf ==

== BEGIN grep net /etc/nsswitch.conf ==
#networks: nisplus [NOTFOUND=return] files
#netmasks: nisplus [NOTFOUND=return] files
netmasks: files
networks: files
netgroup: nisplus
== END grep net /etc/nsswitch.conf ==

== BEGIN chkconfig --list | grep -Ei 'network|wpa' ==
network 0:off 1:off 2:on 3:on 4:on 5:on 6:off
== END chkconfig --list | grep -Ei 'network|wpa' ==

[/code]

User avatar
TrevorH
Site Admin
Posts: 33219
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: multiple ip addresses on eth0

Post by TrevorH » 2012/04/19 10:03:24

You seem to have two default routes and that will confuse things rather!

I suspect that what you need to do is choose which of the two IP addresses you want to use as the default route and remove the GATEWAY line from the ifcfg file for the other and then set up source based routing for it instead. A quick google for "source based routing centos" should guide you on how to achieve this.

tuurtnt
Posts: 9
Joined: 2011/02/08 10:31:50

Re: multiple ip addresses on eth0

Post by tuurtnt » 2012/04/19 13:25:15

[quote]
TrevorH wrote:
You seem to have two default routes and that will confuse things rather!

I suspect that what you need to do is choose which of the two IP addresses you want to use as the default route and remove the GATEWAY line from the ifcfg file for the other and then set up source based routing for it instead. A quick google for "source based routing centos" should guide you on how to achieve this.[/quote]

ok thanks... I found this tutorial, is this what I need? http://kindlund.wordpress.com/2007/11/19/configuring-multiple-default-routes-in-linux/

User avatar
TrevorH
Site Admin
Posts: 33219
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: multiple ip addresses on eth0

Post by TrevorH » 2012/04/20 00:49:07

I sort of stopped reading that link when it started talking about compiling stuff and running make config for the kernel. You don't need to do any of that as it's all there waiting to be used on CentOS. This [url=http://sysadminsjourney.com/content/2009/04/15/doing-simple-source-policy-routing-centos/]link[/url] seemed to be simpler and I think probably does what you want if suitably changed for your environment.

hawkmage
Posts: 162
Joined: 2011/12/17 00:00:11

Re: multiple ip addresses on eth0

Post by hawkmage » 2012/04/20 14:51:16

As far as I know there should only one default route.

A default route is the route that packets take if there is no specific route to follow so if you have two defaults routs how does the system know which one to use?

Looking at the info you posted besides the two default routes you have a route causing 141.138.141.0/24 addresses to go out interface eth0 instead of eht0:0

pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact:

Re: multiple ip addresses on eth0

Post by pschaff » 2012/04/20 14:57:04

I think Trevor covered that territory back about post #11. Please don't jump in unless you have something new to add.

hawkmage
Posts: 162
Joined: 2011/12/17 00:00:11

Re: multiple ip addresses on eth0

Post by hawkmage » 2012/04/20 15:55:44

I did have something new:
[quote]besides the two default routes you have a route causing 141.138.141.0/24 addresses to go out interface eth0 instead of eht0:0[/quote]

User avatar
AlanBartlett
Forum Moderator
Posts: 9345
Joined: 2007/10/22 11:30:09
Location: ~/Earth/UK/England/Suffolk
Contact:

Re: multiple ip addresses on eth0

Post by AlanBartlett » 2012/04/20 23:28:59

I would prefer not to have to post to this thread with regards to "point scoring" arguments.

Please keep things focused and just assist the OP with the issue in question.

Post Reply