Browse code

AWS AMI: Add template to enable jumbo frames (MTU 9001 bytes) in AMI

Amazon AWS supports 9001 byte network MTU (jumbo frames) on many
modern instance types, which increases the network throughput quite a
bit, as compared to the default MTU of 1500 bytes. So configure the
MTU to be 9001 bytes in Photon OS AMIs, by using the value recommended
by the DHCP server (which will be 9001 when running on AWS).

However, changing the MTU size from the default should be done with
care to avoid network issues, and on AWS, this may involve setting up
additional ICMP rules in the security configuration for VMs with
internet-bound traffic. But those steps are beyond the scope of the
AMI itself, so we simply add a template to enable jumbo frames in
Photon OS but leave it disabled; the user can enable it if his/her
overall setup is configured correctly for large MTUs.

Change-Id: I5af7b137abae0fcf00cb110093cdba622983c631
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/4918
Tested-by: gerrit-photon <photon-checkins@vmware.com>
Reviewed-by: Dheeraj S Shetty <dheerajs@vmware.com>

Srivatsa S. Bhat authored on 2018/03/21 15:34:16
Showing 1 changed files
... ...
@@ -10,6 +10,13 @@ echo "127.0.0.1 localhost" >> /etc/hosts
10 10
 echo "DNS=169.254.169.253" >> /etc/systemd/resolved.conf
11 11
 echo "Domains=ec2.internal" >> /etc/systemd/network/99-dhcp-en.network
12 12
 
13
+# Add a DHCP section, but comment out the MTU setting that enables
14
+# jumbo frames (9001 byte MTU) on AWS. Users who have the right
15
+# overall setup (eg: who have configured the necessary ICMP rules in
16
+# their security group to handle large MTUs correctly for
17
+# internet-bound traffic) can then choose to enable jumbo frames on
18
+# the system by simply uncommenting this line.
19
+echo -e "\n[DHCP]\n#UseMTU=true" >> /etc/systemd/network/99-dhcp-en.network
13 20
 
14 21
 # Remove ssh host keys and add script to regenerate them at boot time.
15 22
 rm -f /etc/ssh/ssh_host_*