• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Resolved Adding a second networking interface

Andreas Otten

New Pleskian
Hi, i have a problem adding a second networking interface on plesk 12.5 and centos 6.6 hosted by amazone (AWS ec2). If i add a second interface from the amazone console i can find it back in centos by ifconfig -a then i see it is attached but not configured, i tried to configure by following: http://kb.odin.com/en/118583 and some other options but everytime when i add a config to the eth1 networking interface it wont work, the server cant restart the network inetrfaces so goed offline, after a reboot it stays offline until i turn the machine off, remove the second network interface and boot again (cold detache).
I also copied the config from the eth0 card and edited it to what was nessecary to be eth1.

Can someone help me why the machine crashes after adding a network interface configuration file (even used a tool to create it from centos but also did not work).

Kind Regards,

Andreas
 
Hi OWEUX LLC,

first of all, the user was last seen at "Andreas Otten was last seen: Mar 17, 2016", which you might notice, if you visit his profile page. It's rather unusual, that a user with this longterm absence will respond.

Second, consider to POST configuration files, if you wish help from the Plesk Community. As well, it would really help, if you consider to post MORE information about your operating system, the Plesk version ( incl. MU! ) and when you describe WHAT you did, to resolve your issue, you will experience quite fast, that people willing to help you either help you with your investigations, or ( according to your given information(s) ) are even able to suggest how you could fix your issue/error/problem.

Third, each reboot will store informations in a log - file ( which log - file depends on your operating system! ), where you are always able to find usefull hints and informations, of what might be wrong or misconfigured. If you consider to post the log - file, it is far easier to investigate your issue/error/problem.

Fourth, pls. be aware, that the suggested KB - article from the thread - starter has been written for "Plesk Automation 11.1" and "Plesk Automation 11.5"

Fifth, you don't mention, if you use a SINGLE network-card, or if you have several ones.
 
For those having the exact same problem here is the link that helped me sort it out:

https://forums.aws.amazon.com/message.jspa?messageID=404398

In my opinion it is step 2 that made the difference:

2. Configured and added the ifcfg script

# ifconfig eth1 <INTERNAL_IP_1> netmask <YOUR_NETMASK>
# ifconfig eth2 <INTERNAL_IP_2> netmask <YOUR_NETMASK>

In "most(?)" cases the IPs given by AWS are on the same subnet mas so IFCONFIG should be able to give you that. Be sure to replace the "sample IPs", "sample SUBNETs", etc. with those of your instance.

In case that link ever goes down (It's an oldie but still valid) -- a copy/paste of that link:


Posted by: Yogi@AWS on Nov 29, 2012
Probably this is a issue of default gateway. Here is a step by step approach that you can take to acomplish it. Lets say you have

eth0 - 10.0.0.10
eth1 - 10.0.0.11
eth2 - 10.0.0.12

1. Turned off iptables & Selinux (Just for test, you may enable it later)
# service iptables stop
# chkconfig iptables off
# vi /etc/selinux/config



changed the policy from enforcing to disabled.

2. Configured and added the ifcfg script

# ifconfig eth1 10.0.0.11 netmask 255.255.255.0
# ifconfig eth2 10.0.0.12 netmask 255.255.255.0



# vi /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
BOOTPROTO=dhcp
ONBOOT=yes
TYPE=Ethernet
USERCTL=yes
PEERDNS=yes
IPV6INIT=no
PERSISTENT_DHCLIENT=yes
DEFROUTE=no
EC2SYNC=yes



Similarly for eth2

3. Bring up the interfaces & reboot the machine

# ifup eth1
# ifup eth2

# init 6



4. SSH'd back to the instance and added routes and rules

# ip route show
10.0.0.0/24 dev eth0 proto kernel scope link src 10.0.0.10
10.0.0.0/24 dev eth1 proto kernel scope link src 10.0.0.11
10.0.0.0/24 dev eth2 proto kernel scope link src 10.0.0.12
169.254.0.0/16 dev eth0 scope link metric 1002
169.254.0.0/16 dev eth1 scope link metric 1003
169.254.0.0/16 dev eth2 scope link metric 1004
default via 10.0.0.1 dev eth0

# ip rule show
0: from all lookup local
32766: from all lookup main
32767: from all lookup default



Add routes --
# ip route add default via 10.0.0.1 dev eth0 tab 1
# ip route add default via 10.0.0.1 dev eth1 tab 2
# ip route add default via 10.0.0.1 dev eth2 tab 3


Make a note, I'm assuming that the ENIs are all in the same subnet. If they are in different subnet, make sure you add routes to the respective gateway for that subnet.

Add rules --
# ip rule add from 10.0.0.10/32 tab 1 priority 500
# ip rule add from 10.0.0.11/32 tab 2 priority 600
# ip rule add from 10.0.0.12/32 tab 3 priority 700


Check the rules. This will now show the metrics
# ip rule show
0: from all lookup local
500: from 10.0.0.10 lookup 1
600: from 10.0.0.11 lookup 2
700: from 10.0.0.12 lookup 3
32766: from all lookup main
32767: from all lookup default

At this point you will be able to telnet, ssh other ENI using EIP. Do note, add routes & add rules part of this guide in step 4 is not persistent and after every reboot it will be lost. You may create a start-up script to do so.
 
Back
Top