cluster:102
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| cluster:102 [2011/06/29 13:55] – created hmeij | cluster:102 [2020/08/24 11:19] (current) – hmeij07 | ||
|---|---|---|---|
| Line 2: | Line 2: | ||
| **[[cluster: | **[[cluster: | ||
| - | This is my second NAT story, for the first one look at [[cluster:51|The Story Of NAT, part 1]] | + | Note #1 |
| + | |||
| + | CentOS 8.1 with the standard firewalld.\\ | ||
| + | If this is of interest to you this was how I managed to get it work: | ||
| + | < | ||
| + | EXTIFACE=MASTER_NODE_EXT_INTERFACE_DEVICE (e.g. eno1) | ||
| + | INTIFACE=MASTER_NODE_INTERNAL_INTERFACE_DEVICE (e.g. eno2) | ||
| + | INTIPADDR=MASTER_IP_OF_INTERNAL_IFAC | ||
| + | PREFIX=PREFIX_OF_INTERNAL_NETWORK | ||
| + | firewall-cmd --change-interface=${EXTIFACE} --zone=public | ||
| + | firewall-cmd --change-interface=${INTIFACE} --zone=trusted --permanent | ||
| + | firewall-cmd --permanent --direct --passthrough ipv4 -t nat -I POSTROUTING -o ${EXTIFACE} -j MASQUERADE -s ${INTIPADDR}/ | ||
| + | firewall-cmd --set-default-zone=trusted | ||
| + | firewall-cmd --reload | ||
| + | </ | ||
| + | |||
| + | And make sure the default route is set on all compute nodes. | ||
| + | |||
| + | Note #2 | ||
| + | |||
| + | configured Shorewall on a cluster | ||
| + | |||
| + | Edit the file / | ||
| + | < | ||
| + | MASQUERADE 192.168.0.0/ | ||
| + | </ | ||
| + | where 192.168.0 is the address range of your node interfaces - clearly you need to change this to fit | ||
| + | en01 is the external interface on the head node | ||
| + | |||
| + | My / | ||
| + | < | ||
| + | nat | ||
| + | nat | ||
| + | </ | ||
| + | so substitute ib0 for your internal ethernet interface | ||
| + | |||
| + | |||
| + | |||
| ==== NAT Story, part 2 ==== | ==== NAT Story, part 2 ==== | ||
| + | |||
| + | This is my second NAT story, for the first one look at [[cluster: | ||
| + | |||
| + | |||
| + | |||
| + | Writing this up so I will remember what I did, and why. Basic problem is this: How do you make a filesystem in a public VLAN available on a private network? | ||
| + | |||
| + | We have a storage device which we refer to as flexstorage.wesleyan.edu which serves up a file system on login node petaltail. | ||
| + | |||
| + | < | ||
| + | |||
| + | [root@petaltail ~]# host flexstorage | ||
| + | flexstorage.wesleyan.edu has address 129.133.24.81 | ||
| + | |||
| + | [root@petaltail ~]# df -h / | ||
| + | Filesystem | ||
| + | flexstorage.wesleyan.edu:/ | ||
| + | | ||
| + | |||
| + | </ | ||
| + | |||
| + | Host petaltail has the following interfaces. | ||
| + | |||
| + | < | ||
| + | |||
| + | eth0 Link encap: | ||
| + | inet addr: | ||
| + | eth1 Link encap: | ||
| + | inet addr: | ||
| + | eth2 Link encap: | ||
| + | inet addr: | ||
| + | eth3 Link encap: | ||
| + | inet addr: | ||
| + | |||
| + | </ | ||
| + | |||
| + | But a compute node on our cluster, for example node b1, has the following interfaces, all private | ||
| + | |||
| + | < | ||
| + | |||
| + | eth0 Link encap: | ||
| + | inet addr: | ||
| + | eth1 Link encap: | ||
| + | inet addr: | ||
| + | |||
| + | </ | ||
| + | |||
| + | So in order to for the compute node b1 to reach the flexstorage server we need to use NAT rules and define a path/ | ||
| + | |||
| + | < | ||
| + | |||
| + | *nat | ||
| + | # fss public to 10.10 | ||
| + | -A POSTROUTING -o eth2 -j MASQUERADE | ||
| + | COMMIT | ||
| + | |||
| + | *filter | ||
| + | # fss public via 10.10 | ||
| + | -A FORWARD -i eth1 -o eth2 -m state --state RELATED, | ||
| + | ... | ||
| + | COMMIT | ||
| + | |||
| + | </ | ||
| + | |||
| + | Next, on the compute nodes we need to add routing path and then mount the file system (using an IP because there is no name resolving). | ||
| + | |||
| + | < | ||
| + | |||
| + | # / | ||
| + | route add -host 129.133.24.81 gw 10.10.100.217 eth1 | ||
| + | mount 129.133.24.81:/ | ||
| + | |||
| + | [root@b1 ~]# df -h / | ||
| + | Filesystem | ||
| + | 129.133.24.81:/ | ||
| + | | ||
| + | |||
| + | </ | ||
| + | |||
| + | There is ofcourse a penalty in performance doing this. | ||
| + | |||
| + | < | ||
| + | |||
| + | [root@petaltail ~]# time dd if=/ | ||
| + | 1000000+0 records in | ||
| + | 1000000+0 records out | ||
| + | 1024000000 bytes (1.0 GB) copied, 107.961 seconds, 9.5 MB/s | ||
| + | |||
| + | real 1m47.964s | ||
| + | user 0m0.322s | ||
| + | sys | ||
| + | |||
| + | [root@b1 ~]# time dd if=/ | ||
| + | 1000000+0 records in | ||
| + | 1000000+0 records out | ||
| + | 1024000000 bytes (1.0 GB) copied, 110.017 seconds, 9.3 MB/s | ||
| + | |||
| + | real 1m50.027s | ||
| + | user 0m0.271s | ||
| + | sys | ||
| + | |||
| + | </ | ||
| + | |||
| \\ | \\ | ||
| **[[cluster: | **[[cluster: | ||
cluster/102.1309355734.txt.gz · Last modified: by hmeij
