in this example it is a full ipip is: 1.1.1.1-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -s 1.1.1.1 -j ACCEPTbut suppose i want to allow any ip that simply starts with:1.1.because for example my internet ip always starts with 1.1. but rest changes time to time.i want to be able to do something like this:-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -s 1.1.* -j ACCEPTi do not think this will work because i think in world of computers they use ranges and etc rather than the wild card symbols. Range stuff looks very complex to me. is there something like this with a wild card style concept ?
How to use partial IP address in /etc/sysconfig/iptables for the -s flag?
linux;centos;security;iptables;ip
To specify the ip address 1.1.*, you would use 1.1.0.0/16.   This notation is used for CIDR (classless inter-domain routing) and is the standard method used to specify blocks of addresses.  The /16 indicates the network includes all of the lower 16 bits of the address, so it matches in this case the address block from 1.1.0.0 to 1.1.255.255.