وبلاگ رسانگار
با ما حرفه ای باشید

سرور مجازی NVMe

نحوه تخصیص Additional IP addresses در هتزنر آلمان

آموزش ست کردن ساب نت هتزنر روی مجازی‎سازی

0 3,103
زمان لازم برای مطالعه: 6 دقیقه

محتوای این بخش آموزش

[عنوان]

آدرس‎آی‎پی اصلی

آدرس IPv4 سرور آدرس ای پی اصلی است که به همراه سرور ارائه شده و بصورت خودکار روی سرور بوسیله DHCP تنظیم می شود

برای IPv6 ای پی دقیقی ست نمی شود ، نصب خودکار ::2 از ساب نت v6 تخصیص داده شده به سرور استفاده می شود

 

With dedicated servers and virtual servers from the CX line, the IPv6 subnet is routed on the link-local address of the network adapter. If additional single IPv4 addresses have been ordered with their own MAC addresses, then the IPv6 subnet can be routed onto their link-local address using the Robot.

The particular link-local address is calculated from the MAC address using RFC 4291 and is automatically configured:

# ip address
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 54:04:a6:f1:7b:28 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::5604:a6ff:fef1:7b28/64 scope link
       valid_lft forever preferred_lft forever

With older virtual server models (VQ/VX lines) there is no routing of the /64 IPv6 subnet. This is a local area network, whereby the ::1 of the subnet is used as the gateway (see below).

Following, 192.0.2.84 is used as the main IPv4 address. It is not a real IP address.

آی‎پی‎های اضافه

هم آی پی های تکی اصلی و هم ساب نت عموما از طریق آی پی اصلی سرور روت می شود ، برای باقی این آموزش ما فرض میکنیم آی پی های زیر روی سرور شما است

  • 2001:db8:61:20e1::/64 (IPv6 Subnet)
  • 192.0.2.92 (تک آی پی )
  • 203.0.113.40/29 (IPv4 ساب نت )

ساب نت تخصیص داده شده میتواند مجدد تقسیم شود ، فروارد شود و یا تخصیص داده شود ، بسته به اینکه شما چطور ترجیح بدهید

With IPv4 the network and broadcast addresses are normally reserved. Based on the above example, that would be the IPs 203.0.113.40 and 203.0.113.47. These addresses may be used when you use IPs from subnet as a secondary IP or as part of a point-to-point setup. As a result, in a /29 subnet all 8 IPs are usable, rather than just 6.

With IPv6 the first address (::0) of the subnet is reserved as the “Subnet-Router anycast” address. IPv6 does not use a broadcast, so the last address is also usable (as opposed to with IPv4).

گیت‎وی سرور

For IPv6 on dedicated servers and virtual servers from the CX line, the gateway is fe80::1. Since this is a link-local address, the explicit specification of the network adapter (usually eth0) is necessary:

# ip route add default via fe80::1 dev eth0

For older virtual server models (VQ/VX lines) the gateway lies within the assigned subnet:

# ip address add 2001:db8:61:20e1::2/64 dev eth0
# ip route add default via 2001:db8:61:20e1::1

For IPv4, the gateway is the first usable address of each subnet:

# Example: 192.0.2.84/26 => Network address is 192.0.2.64/26
#
# ip address add 192.0.2.84/32 dev eth0
# ip route add 192.0.2.65 dev eth0
# ip route add default via 192.0.2.65

تک‎آی‎پی ها

آی پی های تخصیص داده شده به شما میتوانند روی همان کارت شبکه به عنوان آی پی اضافه استفاده شود ، برای اینکه مطمئن شوید ای پی های بعد از ریبوت سرور همچنان در دسترس هستند ، تنظیمات بر اساس سیتسم عامل و یا توضیح لینوکسی لازم است تا اعمال شود

پیشنهاد می‌کنیم بخوانید:  تفاوت هاست‌ ، سرور مجازی و سرور اختصاصی

Further details can be found on the pages for Debian/Ubuntu and CentOS.

اضافه کردن ای پی اضافه

ip address add 192.0.2.92/32 dev eth0

روش دیگر ، میتواند در سرور فروارد شود ( مثلا برای ماشین‎های مجازی )

ip route add 192.0.2.92/32 dev tap0
# یا
ip route add 192.0.2.92/32 dev br0

ماشین مجازی باید از آی پی سرور اصلی به عنوان Default gateway استفاده کند

ip route add 192.0.2.84 dev eth0
ip route add default via 192.0.2.84

وقتی که ی پی را فروارد میکنید مطمئن شوید که Ip Forwarding فعال باشد

sysctl -w net.ipv4.ip_forward=1

If a separate MAC address has been set for the IP address via the Robot, then the corresponding gateway of the IP address needs to be used.

ساب‎نت ها

Newly assigned IPv4 subnets are statically routed on the main IP address of the server, so no gateway is required.

The IPs can be assigned as secondary addresses to the network adapters, just like single additional IPs:

 ip address add 203.0.113.40/32 dev eth0

They can also be forwarded individually or as a whole.

ip route add 203.0.113.40/29 dev tun0
# or
ip route add 203.0.113.40/32 dev tap0

Unlike single IPs, subnet IPs can also be assigned (to virtual machines) using DHCP. Therefore an address from the subnet needs to be configured on the host sytem.

ip address add 203.0.113.41/29 dev br0

The hosts on br0 use this address as the gateway. Unlike single IPs the rules for subnets then apply, i.e. network and broadcast IP cannot be used.

For IPv6 the routing of the subnet on the link-local address leads to many possibilities for further division of the subnet in various sizes (/64 up to and including /128). For example:

2a01:04f8:0061:20e1:0000:0000:0000:0000
                   │    │    │    │
                   │    │    │    └── /112 Subnet
                   │    │    │
                   │    │    └── /96 Subnet
                   │    │
                   │    └── /80 Subnet
                   │
                   └── /64 Subnet

Before forwarding, make sure that it is active:

sysctl -w net.ipv6.conf.all.forwarding=1 net.ipv4.ip_forward=1

The entire subnet can be forwarded (e.g. VPN):

ip route add 2001:db8:61:20e1::/64 dev tun0

Or just a part:

ip route add 2001:db8:61:20e1::/80 dev br0

From a single subnet individual addresses can be extracted, while the remainder is forwarded. Note the prefix lengths:

ip address add 2001:db8:61:20e1::2/128 dev eth0
ip address add 2001:db8:61:20e1::2/64 dev br0

The hosts on br0 will show 2001:db8:61:20e1::2 as the gateway.

SLAAC (IPv6)

Furthermore, SLAAC (Stateless Address Autoconfiguration) can be used in the connected hosts (br0), by installing „radvd“ on the host. The configuarion in /etc/radvd.conf requires that the host possesses an address from 2001:db8:61:20e1:: on the bridge or Tap device:

interface tap0
{
        AdvSendAdvert on;
        AdvManagedFlag off;
        AdvOtherConfigFlag off;
        prefix 2001:db8:61:20e1::/64
        {
                AdvOnLink on;
                AdvAutonomous on;
                AdvRouterAddr on;
        };
        RDNSS 2001:db8:0:a0a1::add:1010
              2001:db8:0:a102::add:9999
              2001:db8:0:a111::add:9898
        {
        };
};

Thus the hosts will automatically receive routes and addresses from the subnet. This can be seen within the hosts:

$ ip address
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 08:00:27:0a:c5:b2 brd ff:ff:ff:ff:ff:ff
    inet6 2001:db8:61:20e1:38ad:1001:7bff:a126/64 scope global temporary dynamic
       valid_lft 86272sec preferred_lft 14272sec
    inet6 2001:db8:61:20e1:a00:27ff:fe0a:c5b2/64 scope global dynamic
       valid_lft 86272sec preferred_lft 14272sec
    inet6 fe80::a00:27ff:fe0a:c5b2/64 scope link
       valid_lft forever preferred_lft forever

(Seen here: privacy address, SLAAC address of the subnet, and the RFC 4291 link-local address of the link.)

پیشنهاد می‌کنیم بخوانید:  چگونه از سرور اختصاصی بیشترین استفاده را ببریم؟

استفاده روی مجازی‎سازی با روش Route

همچنین صفحه مجازی سازی را در سایت دیتاسنتر مشاهده کنید : Category:Virtualization

X-route.pngدر روش روت کردن ، یک اینترفیس جدید روی سرور پیکربندی می شود که یک یا بیشتر سرور مجازی از آن استفاده خواهند کرد  ، در این مدل خود سرور به عنوان روتر عمل میکند ،

مزیت مدل روتینگ این است که ترفایک از سرور اصلی عبور میکند این برای ابزارهای عیب یابی مثل (tcpdump, traceroute) کاربردی خواهد لود ، همچنین برای اعمال رول های از طریق فایروال سرور اصلی ( HOST ) فیلترینگ ترافیک روی ماشین های مجازی لازم است .

برخی راهکارهای مجازی سازی یک کارت شبکه به ازای هر واحد ایجاد میکند ،( مثلا XEN و LXC ) و ممکن است با یک سویچ مجازی ( virtual switch ) جفت شود ،( با اینترفیس از نوع TAP یا bridged )

  • Xen: For each domU an interface vifM.N (unfortunately with dynamic numbers) shows up in the dom0. These can be assigned addresses accordingly. Alternatively VIFs can be combined into a segment using a bridge interface; this is achieved via vif=['mac=00:16:3e:08:15:07,bridge=br0',] directives, in /etc/xen/vm/meingast.cfg.
  • VirtualBox: Guests are tied to an existing TAP interface and thus form a segment per TAP device. Create TAP interfaces according to your distribution. In the settings dialog of a single machine, select for assignment: Network > Attached to: “Bridged Adapter”. Name: “tap0”.
  • VMware Server/Workstation: Using your VMware programs create a host-only interface (e.g. vmnet1) and add to it the address area. Assign the VMs to this created host-only interface.
  • Linux Containers (LXC, systemd-nspawn, OpenVZ): For each container an interface ve-… shows up in the parent. These can be assigned addresses accordingly. Alternatively, VE interfaces can be combined with a bridge interface.
  • QEMU: از TAB استفاده می کنند مانند VirtualBOX

استفاده روی مجازی‎سازی با روش Brdige

X-bridge.png

مدل Bridged پیکربندی را تشریح می‎کند که به ماشین مجازی اجازه میدهد ماشین مجازی مستقیم با کارت شبکه متصل به سرور Bridge شود ، دقیقا مانند یک سرور فیزیکی این معمولا برای تک آی پی های است ، ساب نت ها همیشه Route می‎شوند

مزیت روش Bridge این است که پیکربندی شبکه معمولا ساده است و نیازی به Routing رول و یا تنظیم Point 2 Point نیاز نیست ، عیب این روش این است که مگ آدرس ماشین مجازی ” قابل مشاهده ” می شود به همین دلیل هر ای پی آدرس باید یک مک آدرس داشته باشد . برای دریافت مک آدرس اختصاصی هر تک آی پی خود با پشتیبانی رسانگار تماس بگیرید .

IPv6 هم باید از طریق این مک آدرس جدید روت شود

  • VMware ESX: ESX sets a bridge to the physical adapter, on which the VM kernel hangs and to which further VMs can be bound. For example, a router VM that runs the actual operating system. In ESX further virtual switches can be defined, which are then made available to the router VM through other NICs.
  • The other virtualization solutions offer bridged mode, but for the sake of simplicity we will restrict ourselves to the simpler routed method, since it is also easier for troubleshooting (e.g. mtr/traceroute). Only ESX urgently requires bridged mode.
  • The use of bridged mode currently requires the sysctl function “net.ipv4.conf.default.proxy_arp=1” (e.g. with Xen).

استفاده از آی‎پی‎ها روی پلتفرم های دیگر

Xen ( ذن )
SUSE ( سوزه )
Debian ( دبیان )
Gentoo ( جنتو )
CentOS ( سنت او اس )
Proxmox ( پروکسموکس )
VMware ESXi ( وی ام ویر )

امتیاز شما به این مطلب
دیدگاه شما در خصوص مطلب چیست ؟

آدرس ایمیل شما منتشر نخواهد شد.

لطفا دیدگاه خود را با احترام به دیدگاه های دیگران و با توجه به محتوای مطلب درج کنید