Explorar o código

adding vlan manual configuration to boot disk

thelamer %!s(int64=5) %!d(string=hai) anos
pai
achega
2a3bf69a95

+ 23 - 0
roles/netbootxyz/templates/disks/netboot.xyz-gce.j2

@@ -24,6 +24,7 @@ goto menu
 menu netboot.xyz Failsafe Menu
 item localboot Boot to local drive
 item netconfig Manual network configuration
+item vlan Manual VLAN configuration
 item retry Retry boot
 item debug iPXE Debug Shell
 item reboot Reboot System
@@ -45,6 +46,28 @@ ifopen net${net}
 echo Attempting chainload of netboot.xyz...
 goto menu || goto failsafe
 
+:vlan
+echo VLAN Configuration:
+echo Available interfaces...
+ifstat
+imgfree
+echo -n Set network interface number [0 for net0, defaults to 0]: ${} && read net
+isset ${net} || set net 0
+echo -n Set VLAN 802.1Q tag [0 to 4094]: ${} && read vlan
+vcreate --tag ${vlan} net${net}
+ifconf --configurator dhcp net${net}-${vlan} || echo DHCP failed trying manual && goto netvlan
+echo Attempting chainload of ${boot_domain}...
+goto menu || goto failsafe
+
+:netvlan
+echo -n IP: && read net${net}-${vlan}/ip
+echo -n Subnet mask: && read net${net}-${vlan}/netmask
+echo -n Gateway: && read net${net}-${vlan}/gateway
+echo -n DNS: && read dns
+ifopen net${net}-${vlan}
+echo Attempting chainload of ${boot_domain}...
+goto menu || goto failsafe
+
 :menu
 set conn_type https
 chain --autofree https://boot.netboot.xyz/menu.ipxe || echo ${HTTPS_ERR}

+ 23 - 0
roles/netbootxyz/templates/disks/netboot.xyz-packet.j2

@@ -25,6 +25,7 @@ goto menu
 menu netboot.xyz Failsafe Menu
 item localboot Boot to local drive
 item netconfig Manual network configuration
+item vlan Manual VLAN configuration
 item retry Retry boot
 item debug iPXE Debug Shell
 item reboot Reboot System
@@ -46,6 +47,28 @@ ifopen net${net}
 echo Attempting chainload of netboot.xyz...
 goto menu || goto failsafe
 
+:vlan
+echo VLAN Configuration:
+echo Available interfaces...
+ifstat
+imgfree
+echo -n Set network interface number [0 for net0, defaults to 0]: ${} && read net
+isset ${net} || set net 0
+echo -n Set VLAN 802.1Q tag [0 to 4094]: ${} && read vlan
+vcreate --tag ${vlan} net${net}
+ifconf --configurator dhcp net${net}-${vlan} || echo DHCP failed trying manual && goto netvlan
+echo Attempting chainload of ${boot_domain}...
+goto menu || goto failsafe
+
+:netvlan
+echo -n IP: && read net${net}-${vlan}/ip
+echo -n Subnet mask: && read net${net}-${vlan}/netmask
+echo -n Gateway: && read net${net}-${vlan}/gateway
+echo -n DNS: && read dns
+ifopen net${net}-${vlan}
+echo Attempting chainload of ${boot_domain}...
+goto menu || goto failsafe
+
 :menu
 set conn_type https
 chain --autofree https://boot.netboot.xyz/menu.ipxe || echo ${HTTPS_ERR}

+ 23 - 0
roles/netbootxyz/templates/disks/netboot.xyz.j2

@@ -29,6 +29,7 @@ goto menu
 menu ${boot_domain} Failsafe Menu
 item localboot Boot to local drive
 item netconfig Manual network configuration
+item vlan Manual VLAN configuration
 item retry Retry boot
 item debug iPXE Debug Shell
 item reboot Reboot System
@@ -50,6 +51,28 @@ ifopen net${net}
 echo Attempting chainload of ${boot_domain}...
 goto menu || goto failsafe
 
+:vlan
+echo VLAN Configuration:
+echo Available interfaces...
+ifstat
+imgfree
+echo -n Set network interface number [0 for net0, defaults to 0]: ${} && read net
+isset ${net} || set net 0
+echo -n Set VLAN 802.1Q tag [0 to 4094]: ${} && read vlan
+vcreate --tag ${vlan} net${net}
+ifconf --configurator dhcp net${net}-${vlan} || echo DHCP failed trying manual && goto netvlan
+echo Attempting chainload of ${boot_domain}...
+goto menu || goto failsafe
+
+:netvlan
+echo -n IP: && read net${net}-${vlan}/ip
+echo -n Subnet mask: && read net${net}-${vlan}/netmask
+echo -n Gateway: && read net${net}-${vlan}/gateway
+echo -n DNS: && read dns
+ifopen net${net}-${vlan}
+echo Attempting chainload of ${boot_domain}...
+goto menu || goto failsafe
+
 :tftpmenu
 isset ${hostname} && chain --autofree tftp://${next-server}/HOSTNAME-${hostname}.ipxe || echo Custom boot by Hostname not found trying MAC...
 chain --autofree tftp://${next-server}/MAC-${mac:hexraw}.ipxe || echo Custom boot by MAC not found booting default...