File: accessip.md

package info (click to toggle)
owncloud 7.0.4%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 104,192 kB
  • sloc: php: 403,584; xml: 5,843; perl: 630; cs: 504; sh: 453; sql: 271; python: 221; makefile: 104
file content (52 lines) | stat: -rw-r--r-- 2,272 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
About the Access IP Addresses
=============================

OpenStack deployments generally provide new [servers](servers.md) with one
or two network interfaces, each with its own address(es). Usually, one of
these will be a public interface, with its addresses available on the Internet.

However, in some cases, the servers are created on an internal network
(this is especially common in a hybrid solution where physical and virtual
servers are intermixed). The servers may be behind a NAT device, firewall,
or other network device that prohibits direct access to the server itself.

The `Server` object provides two attributes that are used to instruct
applications what IP address to use. These are called the *access IP*
addresses, and they are, in essence, documentation strings used to
direct applications to the correct network address. They can be changed
at will by the server's owner, and OpenStack Nova does not perform any
validation on them:

* `accessIPv4` holds the IPv4 access address, and
* `accessIPv6` holds the IPv6 access address.

### Updating the access IP address(es)

For example, you may have a private cloud with internal addresses in the
10.1.x range. However, you can access a server via a firewall device at
address 50.57.94.244. In this case, you can change the `accessIPv4` attribute
to point to the firewall:

    $compute = $cloud->Compute();
    $server = $compute->Server('908c5617-26c2-4535-99a9-3f20e4b74835');
    $server->Update(array('accessIPv4'=>'50.57.94.244'));

When a client application retrieves the server's information, it will know
that it needs to use the `accessIPv4` address to connect to the server, and
*not* the IP address assigned to one of the network interfaces.

### Retrieving the server's IP address

The `Server::ip()` method is used to retrieve the server's IP address.
It has one optional parameter: the format (either IPv4 or IPv6) of the address
to return (by default, it returns the IPv4 address):

	$server = $compute->Server('...');	// get a server
	print $server->ip();				// the IPv4 address
	print $server->ip(4);				// the IPv4 address, too
	print $server->ip(6);				// the IPv6 address
	print $server->ip(8);				// causes an exception

## What next?

Return to the [Table of Contents](toc.md)