03-22-2007
jim...nope doesnt work...
works for the last octet though ...and is not linear after that.
thanks anyway. wills stick with my old method.
Quote:
Originally Posted by jim mcnamara
Try it and see - I've never used it that way. I believe the code works modulo 255 as you seem to indicate.
If you are shooting at enumerating the various ip addresses in your local network, there are more efficient ways than guessing ip's.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have a new challenge that I need some help with. Each morning I have two files that contain working units and failed units that I join together to form file3 which is FTP to server for comparison against billing system.
My problem, I would like to take joined data in file3 and add a field... (2 Replies)
Discussion started by: greengrass
2 Replies
2. UNIX and Linux Applications
Hi All,
I found my weblog contain entries like 121.23.3 Instead of four octet.
I am quite confused is it possible to have 3 octet ip at all ??
Is it generating by any program and hittng the website ?
Is it a subdomain ?
Please tell me your understanding on it ?
Thanks (4 Replies)
Discussion started by: jambesh
4 Replies
3. UNIX for Dummies Questions & Answers
I have a file that varies in the # of records. I want to read 1000 records, do something, read the next 1000 records, do something, going in 1000 increment chunks, and then finish up with whatever is left over at end of file. (1 Reply)
Discussion started by: Tsamp
1 Replies
4. Shell Programming and Scripting
Hi, I only have a very limited understanding and experience with writing code and I was hoping I could get some help.
I have a dataset of two columns (txt format, numbers in each row separated by a tab)
Eg.
1 5
2 5
3 6
4 7
5 6
6 6
7 ... (5 Replies)
Discussion started by: Emred_Skye
5 Replies
5. Shell Programming and Scripting
Hi All,
I am trying to implement a for loop in a .sh file and execute it.
My for loop is
for i in 1, 200, 400, 600, 800, 1000, 1200,......100000
do
...
..
..
done
As you could see there is an increment of 200 in each for loop until it reaches 100,000
Instead of specifying all the... (8 Replies)
Discussion started by: Lucky Ali
8 Replies
6. UNIX for Dummies Questions & Answers
I'm trying to learn as much about GRUB as I can and it's stages are stored in these types of files.
Any info or search terms is appreciated!:wall: (5 Replies)
Discussion started by: theKbStockpiler
5 Replies
7. Shell Programming and Scripting
Hi Experts,
I am trying to print $2 & the IP_address upto 3rd octet only.
But unable to do so, Trying # awk '{print $2, substr($4,1,9)}' file . but not correct
File:
HOST= cmiHOST06 :: 10.26.107.73:/data120 /nbu/cmiHOST06/athpx07/aa1
HOST= cmiHOST05 :: 10.26.12.76:/data120... (5 Replies)
Discussion started by: rveri
5 Replies
8. Shell Programming and Scripting
Experts,
In one example I have seen how to get output upto 3rd octet, when there is a ":" separated with the 4rth octet.
However in this example how to remove 4rth octet and to keep upto 3rd octet with regular expressions and awk sub function:
I have tried with :but not working:
# awk '{... (3 Replies)
Discussion started by: rveri
3 Replies
9. Programming
no longer needed, please delete thread. (0 Replies)
Discussion started by: xtina
0 Replies
10. Shell Programming and Scripting
Hello,
Im looking to help out my team by automating a simple search list. The user will look for a peering ip /30. For example 192.168.1.2/30 and gets the result. Im trying to get the entered /30 and subtract the last octet by one.
echo -n "Enter peering ip : "; read peeringip
cat... (3 Replies)
Discussion started by: D'go
3 Replies
LEARN ABOUT LINUX
netmasks
netmasks(4) File Formats netmasks(4)
NAME
netmasks - network mask database
SYNOPSIS
/etc/inet/netmasks
/etc/netmasks
DESCRIPTION
The netmasks file contains network masks used to implement IP subnetting. It supports both standard subnetting as specified in RFC-950 and
variable length subnetting as specified in RFC-1519. When using standard subnetting there should be a single line for each network that is
subnetted in this file with the network number, any number of SPACE or TAB characters, and the network mask to use on that network. Network
numbers and masks may be specified in the conventional IP `.' (dot) notation (like IP host addresses, but with zeroes for the host part).
For example,
128.32.0.0 255.255.255.0
can be used to specify that the Class B network 128.32.0.0 should have eight bits of subnet field and eight bits of host field, in addition
to the standard sixteen bits in the network field.
When using variable length subnetting, the format is identical. However, there should be a line for each subnet with the first field being
the subnet and the second field being the netmask that applies to that subnet. The users of the database, such as ifconfig(1M), perform a
lookup to find the longest possible matching mask. It is possible to combine the RFC-950 and RFC-1519 form of subnet masks in the net-
masks file. For example,
128.32.0.0 255.255.255.0
128.32.27.0 255.255.255.240
128.32.27.16 255.255.255.240
128.32.27.32 255.255.255.240
128.32.27.48 255.255.255.240
128.32.27.64 255.255.255.240
128.32.27.80 255.255.255.240
128.32.27.96 255.255.255.240
128.32.27.112 255.255.255.240
128.32.27.128 255.255.255.240
128.32.27.144 255.255.255.240
128.32.27.160 255.255.255.240
128.32.27.176 255.255.255.240
128.32.27.192 255.255.255.240
128.32.27.208 255.255.255.240
128.32.27.224 255.255.255.240
128.32.27.240 255.255.255.240
128.32.64.0 255.255.255.192
can be used to specify different netmasks in different parts of the 128.32.0.0 Class B network number. Addresses 128.32.27.0 through
128.32.27.255 have a subnet mask with 28 bits in the combined network and subnet fields (often referred to as the subnet field) and 4 bits
in the host field. Furthermore, addresses 128.32.64.0 through 128.32.64.63 have a 26 bits in the subnet field. Finally, all other
addresses in the range 128.32.0.0 through 128.32.255.255 have a 24 bit subnet field.
Invalid entries are ignored.
SEE ALSO
ifconfig(1M), inet(7P)
Postel, Jon, and Mogul, Jeff, Internet Standard Subnetting Procedure, RFC 950, Network Information Center, SRI International, Menlo Park,
Calif., August 1985.
V. Fuller, T. Li, J. Yu, K. Varadhan, Classless Inter-Domain Routing (CIDR): an Address Assignment and Aggregation Strategy, RFC 1519,
Network Information Center, SRI International, Menlo Park, Calif., September 1993.
T. Pummill, B. Manning, Variable Length Subnet Table For IPv4, RFC 1878, Network Information Center, SRI International, Menlo Park, Calif.,
December 1995.
NOTES
/etc/inet/netmasks is the official SVr4 name of the netmasks file. The symbolic link /etc/netmasks exists for BSD compatibility.
SunOS 5.10 7 Jan 1997 netmasks(4)