Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Parsing subnet
2016-10-19, 03:10
Post: #3
RE: Parsing subnet
(2016-10-18 18:18)NiKiZe Wrote:  
(2016-10-18 15:44)Yeswanth Wrote:  I have a query. I want to get the first three numbers from the subnet mask.

For example

Net0/netmask = 192.169.168.34

But i need to get first 3 digits, my output should be like 192.169.168

(assuming that you ment to type netX/ip and not net0/netmask, or that the mask actually is a valid mask?)
There is no way inside of iPXE (yet) to parse parts of anything. The recommended way if you really need this is to do it server side, that is doing chain http://server/script?ip=${netX/ip}
Which in turn returns something like
Code:
#!ipxe
set ippart 192.169.168

but most of the time when someone asks similar things about getting part of ip, normally it is for some kind of logic where gateway or dns would make more sense to use.

What will you use this 3octet mask for?





Hi

Thanks for the reply

Dhcp server will assign some ip's and subnet to some boards and i need to verify that if the subnet mask iseq to the 192.168.169 (i.e the first 3 octet) then i proceeding with execution of some steps or else i will retry
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Parsing subnet - Yeswanth - 2016-10-18, 15:44
RE: Parsing subnet - NiKiZe - 2016-10-18, 18:18
RE: Parsing subnet - Yeswanth - 2016-10-19 03:10
RE: Parsing subnet - NiKiZe - 2016-10-19, 07:15



User(s) browsing this thread: 1 Guest(s)