Difference between revisions of "Boot SPARC server behind NAT over the Internet from VM also behind NAT"

From Aram's Wiki
Jump to: navigation, search
(Instructions)
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
[[Category:Solaris]]
 
[[Category:Solaris]]
 +
[[Category:Networking]]
  
 
== Topology ==
 
== Topology ==
  
 
<pre style="white-space: pre;">
 
<pre style="white-space: pre;">
 
+
  +----------------+
      +--------------------+
+
  |               |
      |                   |
+
  | SPARC server |
      | SPARC server       |
+
  |               |
      | 192.168.0.60      |
+
  +-+--------------+
      |                    |
+
    | 192.168.0.60
      +--------------------+
+
    |
              |                     +-------------------------------------+
+
    |
              |                      |  Router #1                          |
+
    |                             +--------------------------------------+
              |                      |                                    |
+
  +-+------+                      |                                      |
              +---------------------->  84.112.126.72   (vienna.mgk.ro)  |
+
   |       |       192.160.0.1/24|    Router #1                        |
                                      | 192.168/24                         |
+
  | Switch +----------------------+                                      |
              +---------------------->                                    |
+
  |        |                      |     84.112.126.72 -> 192.160.0.100   |
              |                      | 84.112.126.72 -> 192.160.0.100     |
+
  +-+------+                     |                                     |
      +---------------------+       |                                     |
+
    |                             +------+-------------------------------+
      |                    |       +-------------------------------------+
+
    |                                    | 84.112.126.72  (vienna.mgk.ro)
      | z800                |                     |
+
    |                                   |
      | 192.168.0.100       |                     |
+
    | 192.168.0.100                      |
      |                    |                      |
+
  +-+--------------+                    |
      +---------------------+       +--------------+
+
  |                |        +-----------+
                                    |
+
  |      z800      |        |
                                    |                         Site #1 (Vienna)
+
  |                |        |
                                    v
+
  +----------------+         |
    +-------------------------+  Internet  +---------------------------------+
+
                              |                         Site #1 (Vienna)
                                    ^
+
                              v
                                    |                         Site #2 (Sibiu)
+
+----------------------+  Internet  +--------------------------------------+
               +----------------------+
+
                              ^
              |
+
                              |                         Site #2 (Sibiu)
 +
               +---------------+
 
               |
 
               |
      +-------------------+               +----------------------+
+
  xx.xx.xx.xx |
      | Router #2        |                |  Router #3 (Vmware) |
+
+------------+--+                                     +--------------------+
      |                   |               |                      |
+
  |               | 172.20/20              172.20.8.xx |                   |
      | xx.xx.xx.xx      +----------------+  172.20.8.xx        |
+
|   Router #2  +---+                      +----------+ Router #3 (VMware) |
      | 172.20/20        |               | 172.16.24/24        |
+
  |               |  |                     |         |                   |
      +-------------------+                +-----------^----------+
+
+---------------+  |                      |          +------------------+-+
                                                      |
+
                    |    +----------+     |                172.16.24/24 |
                                                      |
+
                    |    |         |    |                            |
                        +-------------------+         |
+
                    +-----+  Switch  +-----+                            |
                        |  Solaris VM      |         |
+
                          |          |                                  |
                        |                  |         |
+
                          +----+-----+                                   |
                        | 172.16.24.128   +---------+
+
                                |                                         |
                        |                   |
+
                                |                                         |
                        +-------------------+
+
                                | 172.20.8.yy              172.16.24.128 |
 +
                          +----+-----+                      +------------+-+
 +
                          |          |                      |             |
 +
                          |  Laptop  |                      |  Solaris VM  |
 +
                          |          |                      |              |
 +
                          +----------+                      +--------------+
  
 
</pre>
 
</pre>
 +
 +
== Strategy ==
 +
 +
The idea is that we have access through ssh to a machine in the same LAN as the server (z800 in the diagram above). We want to make the SPARC server think it's booting from this machine, while we're in fact using ssh port forwarding to forward inbound connection to that machine to our VM.
  
 
== Instructions ==
 
== Instructions ==
Line 55: Line 66:
  
 
Set-up SPARC AI server:
 
Set-up SPARC AI server:
  pfexec installadm create-service -a sparc  
+
  vm# pfexec installadm create-service -a sparc
  
 
Make a client-specific AI config:
 
Make a client-specific AI config:
Line 62: Line 73:
  
 
Set-up remote port forwarding:
 
Set-up remote port forwarding:
  ssh -S none -NT -R 5555:172.16.24.128:5555 -L 8080:192.168.0.1:80 vienna.mgk.ro  
+
  laptop$ ssh -S none -NT -R 5555:172.16.24.128:5555 -L 8080:192.168.0.1:80 vienna.mgk.ro
  
 
Set-up SPARC machine to netboot using static IP:
 
Set-up SPARC machine to netboot using static IP:
  setenv network-boot-arguments host-ip=192.168.0.60,router-ip=192.168.0.1,subnet-mask=255.255.255.0,file=http://192.168.0.100:5555/cgi-bin/wanboot-cgi  
+
  ok setenv network-boot-arguments host-ip=192.168.0.60,router-ip=192.168.0.1,subnet-mask=255.255.255.0,file=http://192.168.0.100:5555/cgi-bin/wanboot-cgi
  boot net
+
  ok boot net

Latest revision as of 10:30, 22 February 2019


Topology

   +----------------+
   |                |
   |  SPARC server  |
   |                |
   +-+--------------+
     | 192.168.0.60
     |
     |
     |                             +--------------------------------------+
   +-+------+                      |                                      |
   |        |        192.160.0.1/24|     Router #1                        |
   | Switch +----------------------+                                      |
   |        |                      |     84.112.126.72 -> 192.160.0.100   |
   +-+------+                      |                                      |
     |                             +------+-------------------------------+
     |                                    | 84.112.126.72  (vienna.mgk.ro)
     |                                    |
     | 192.168.0.100                      |
   +-+--------------+                     |
   |                |         +-----------+
   |      z800      |         |
   |                |         |
   +----------------+         |
                              |                          Site #1 (Vienna)
                              v
+----------------------+  Internet  +--------------------------------------+
                              ^
                              |                          Site #2 (Sibiu)
              +---------------+
              |
  xx.xx.xx.xx |
 +------------+--+                                     +--------------------+
 |               | 172.20/20               172.20.8.xx |                    |
 |   Router #2   +---+                      +----------+ Router #3 (VMware) |
 |               |   |                      |          |                    |
 +---------------+   |                      |          +------------------+-+
                     |     +----------+     |                172.16.24/24 |
                     |     |          |     |                             |
                     +-----+  Switch  +-----+                             |
                           |          |                                   |
                           +----+-----+                                   |
                                |                                         |
                                |                                         |
                                | 172.20.8.yy               172.16.24.128 |
                           +----+-----+                      +------------+-+
                           |          |                      |              |
                           |  Laptop  |                      |  Solaris VM  |
                           |          |                      |              |
                           +----------+                      +--------------+

Strategy

The idea is that we have access through ssh to a machine in the same LAN as the server (z800 in the diagram above). We want to make the SPARC server think it's booting from this machine, while we're in fact using ssh port forwarding to forward inbound connection to that machine to our VM.

Instructions

Install Solaris 11 (amd64) in VMware, on laptop.

Set-up SPARC AI server:

vm# pfexec installadm create-service -a sparc

Make a client-specific AI config:

cp /etc/netboot/{system,webboot}.conf /etc/netboot/cl.ie.nt.ip 

Edit /etc/netboot/client-ip/webboot.conf to reference client (e.g. behind NAT) IPs.

Set-up remote port forwarding:

laptop$ ssh -S none -NT -R 5555:172.16.24.128:5555 -L 8080:192.168.0.1:80 vienna.mgk.ro

Set-up SPARC machine to netboot using static IP:

ok setenv network-boot-arguments host-ip=192.168.0.60,router-ip=192.168.0.1,subnet-mask=255.255.255.0,file=http://192.168.0.100:5555/cgi-bin/wanboot-cgi
ok boot net