Private Network configuration [Part 3]

Continuation of  the Lock it down series.

The network configuration is going to be a tricky thing for someone if they’re not use to setting up network interfaces, but knowing how to is the most important thing you can know when dealing with virtual servers like these when you start looking at Cloning, Private Networks, and the VPN.

So let’s go ahead and create the private network we’ll use in the 1&1 CloudPanel. For this series, I used a network address of 10.0.0.0 and a subnet of 255.255.0.0. The reason for this is because I like to keep things as nice and pretty as I can. My main production servers run on 10.0.0.0/24, as I doubt I’ll never need or have more than 254 servers. In this series I’m using 10.0.1.0/24 to designate webservers and 10.0.2.0/24 to designate databases.

In the real world, if you doubt that you’ll ever have more than 254 (i think 1&1’s limit is 99 per contract?) than sticking with the consumer’s 192.168.0.0/24 could be perfect for you (192.168.0.0 | 255.255.255.0)

So now with your Private Network, assign your servers and you should end up similar to this:

privatenetworks

When everything is “Active” then you should be able to run an ifconfig and see that an eth1 has been created

# ifconfig
eth0 Link encap:Ethernet HWaddr 00:50:56:21:5F:CA
 inet addr:70.35.202.104 Bcast:70.35.202.104 Mask:255.255.255.255
 inet6 addr: fe80::250:56ff:fe21:5fca/64 Scope:Link
 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
 RX packets:111515 errors:0 dropped:0 overruns:0 frame:0
 TX packets:35131 errors:0 dropped:0 overruns:0 carrier:0
 collisions:0 txqueuelen:1000
 RX bytes:220935348 (210.7 MiB) TX bytes:2428700 (2.3 MiB)

eth1 Link encap:Ethernet HWaddr 00:50:56:33:C7:14
  UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
 RX packets:555 errors:0 dropped:0 overruns:0 frame:0
 TX packets:21 errors:0 dropped:0 overruns:0 carrier:0
 collisions:0 txqueuelen:1000
 RX bytes:33370 (32.5 KiB) TX bytes:1448 (1.4 KiB)

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:65536 Metric:1
 RX packets:0 errors:0 dropped:0 overruns:0 frame:0
 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
 collisions:0 txqueuelen:0
 RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)

Here we need to grab our “HWAddr” so that we can configure our Network Interface script to apply an IP to the correct interface. So let’s swing over to our network-scripts and configure our IP.

# vi /etc/sysconfig/network-scripts/ifcfg-eth1

DEVICE="eth1"
BOOTPROTO="static"
ONBOOT="yes"
HWADDR=00:50:56:33:C7:14
NETMASK=255.255.0.0
IPADDR=10.0.2.1
TYPE="Ethernet"

# ifup eth1
Determining if ip address 10.0.2.1 is already in use for device eth1...

Do the same for the webserver as well. If you did everything correctly, your ifconfig should look like this, along with the ability to ping each other:

# ifconfig
eth0 Link encap:Ethernet HWaddr 00:50:56:21:5F:CA
 inet addr:70.35.202.104 Bcast:70.35.202.104 Mask:255.255.255.255
....

eth1 Link encap:Ethernet HWaddr 00:50:56:33:C7:14
 inet addr:10.0.2.1 Bcast:10.255.255.255 Mask:255.255.0.0
 inet6 addr: fe80::250:56ff:fe33:c714/64 Scope:Link
 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
 RX packets:555 errors:0 dropped:0 overruns:0 frame:0
 TX packets:21 errors:0 dropped:0 overruns:0 carrier:0
 collisions:0 txqueuelen:1000
 RX bytes:33370 (32.5 KiB) TX bytes:1448 (1.4 KiB)

...

# ping 10.0.1.1
PING 10.0.1.1 (10.0.1.1) 56(84) bytes of data.
64 bytes from 10.0.1.1: icmp_seq=1 ttl=64 time=1.01 ms
64 bytes from 10.0.1.1: icmp_seq=2 ttl=64 time=0.230 ms


Now we should be rocking and rolling.

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.