multiple ip addresses on eth0

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

multiple ip addresses on eth0

Post by tuurtnt » 2012/04/18 11:50:34

Hi guys,

I have a centos 6.2 server (vps). Now I ordered an extra (public) ip address. I tried a lot of manuals on configuring this, but it does not work for me... Can anyone help?

These are my config scripts:

file: ifcfg-eth0
[code]
DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
TYPE=Ethernet
USERCTL=no
IPV6INIT=no
IPV6FORWARDING=no
HWADDR=52:54:00:33:9e:d9
IPADDR=141.138.136.xx
NETMASK=255.255.255.0
GATEWAY=141.138.136.1
[/code]

file: ifcfg-eth0:0
[code]
DEVICE=eth0:0
BOOTPROTO=static
ONBOOT=no
TYPE=Ethernet
USERCTL=no
IPV6INIT=no
IPV6FORWARDING=no
IPADDR=141.138.141.xxx
NETMASK=255.255.255.0
GATEWAY=141.138.141.1
BROADCAST=141.138.141.255
ONPARENT=yes
NM_CONTROLLED=no
[/code]

if I run ifconfig:

[code]
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
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:22162 errors:0 dropped:0 overruns:0 frame:0
TX packets:6004 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:4326381 (4.1 MiB) TX bytes:1886162 (1.7 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:677 errors:0 dropped:0 overruns:0 frame:0
TX packets:677 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:778370 (760.1 KiB) TX bytes:778370 (760.1 KiB)
[/code]


It creates eth0:0 but I cannot ping the gateway of eth0:0 (eth0 gateway does work). Also I cannot ping the eth0:0 ipaddress (I can ping eth0 ip address)

Can anybody help me?

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

Re: multiple ip addresses on eth0

Post by tuurtnt » 2012/04/18 14:22:12

I want this because of an SSL connection for a website...

User avatar
jlehtone
Posts: 4523
Joined: 2007/12/11 08:17:33
Location: Finland

Re: multiple ip addresses on eth0

Post by jlehtone » 2012/04/18 14:40:44

[quote]
tuurtnt wrote:
I want this because of an SSL connection for a website...[/quote]
Why would SSL require an additional IP?

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

Re: multiple ip addresses on eth0

Post by tuurtnt » 2012/04/18 15:46:48

Because SNI is not an option for me....

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

Re: multiple ip addresses on eth0

Post by tuurtnt » 2012/04/18 20:57:59

anyone an idea?

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

multiple ip addresses on eth0

Post by pschaff » 2012/04/18 21:11:55

Still no idea why you need a second IP address to use SSL. See the upstream [url=http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Deployment_Guide/ch-Web_Servers.html#s2-apache-mod_ssl]Deployment Guide Section 14.1.8. Setting Up an SSL Server[/url].

P.S.:
[url=http://www.centos.org/modules/newbb/viewtopic.php?topic_id=28726&forum=54]Readme First[/url]:

[quote]
[b][size=120]12. What to do if no one answers[/size][/b]

Please wait for at least 24 hours. The volunteers on this forum live all over the world. If it's day time where you live, it's going to be night time somewhere else and the person able to answer your question may be sleeping, so give everyone a chance to read your question. Be sure that you have refreshed the page if you left it open - new messages do not cause an auto-refresh. Also, be sure to check your Notification Method - at the bottom of each page when logged in - as it defaults to "Private Message", not email as many people seem to expect.

[b][color=000080]If after 24 hours you haven't received any answers, then you may bump your thread by posting more information. By more information, we mean what you have tried during the last 24 hours to fix the problem. You have been trying to fix your problem, haven't you and not just waiting for someone else to fix it for you?[/color][/b]
[/quote]

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

Re: multiple ip addresses on eth0

Post by TrevorH » 2012/04/18 22:39:55

Reading between the lines I think the OP wants to run multiple SSL sites using the same Apache instance and have them use separate certificates.

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

Re: multiple ip addresses on eth0

Post by tuurtnt » 2012/04/19 08:03:03

[quote]
TrevorH wrote:
Reading between the lines I think the OP wants to run multiple SSL sites using the same Apache instance and have them use separate certificates.[/quote]

yes I have multiple vhosts with ssl... (but don't want to use SNI (lot of people still use XP... :-(

User avatar
jlehtone
Posts: 4523
Joined: 2007/12/11 08:17:33
Location: Finland

Re: multiple ip addresses on eth0

Post by jlehtone » 2012/04/19 08:43:31

So, you will need multiple IP's then.

[url=http://www.fwbuilder.org/4.0/docs/users_guide/heartbeat_cluster.html]getinfo.sh network[/url] could help. You have not shown all details of your configuration yet.

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]

Post Reply