Read about ip address subnet mask gateway dns server, The latest news, videos, and discussion topics about ip address subnet mask gateway dns server from alibabacloud.com
The Ip2long IP address is converted to an integer type.Long2ip integer data is converted to IP. The subnet mask is converted to a mask length mode:$slash _notation = strlen (Preg_replace ("/0/", "", Decbin (Ip2long ($
represents the different hosts within the network segmentAttention:Private IP is an IP address that everyone can access for use in the intranet.Let's explain what a subnet mask is, why put this concept with an IP
There are two ways to compute the subnet mask:
Method One: Use the subnet number to calculate:
1. First of all, the number of subnets from the decimal number into binary number;
2. Then, the number of digits of the binary number obtained by the statistic is set to n;
3. Finally, the subnet
Not much to say, directly on the code.Package Com.ckw.test;import Java.io.BufferedReader; Import java.io.IOException; Import Java.io.inputstreamreader;import Java.util.*;import Java.util.map.entry;public class TestOfSubNetMask {Map The result is:---------------------------------------------------------------Windows IP Configuration host name ............. : DADI primary DNS suffix ........... : node type ..
IP address segment: 210.143.144.1 ~ 210.143.159.254,
210.143. (1001) 0000.00000000 indicates the network address and identifies a network,
210.143. (1001) 1111.11111111 is the broadcast address, which can broadcast messages to all addresses in the network.
This CIDR block is equivalent to 210.143.144.0/20, that is, 210
This example describes a Python implementation method that calculates a network segment based on an IP address and subnet mask. Share to everyone for your reference. Specific as follows:
This code is tested in the Linux environment 2.6.6python version!
#!/usr/bin/env python#_*_encoding:utf-8_*_#input your
: System: UbuntuServer11.10IP address: 192.168.21.168 subnet mask: 255.255.255.0 Gateway: 192.168.21.2DNS: 8.8.8.88.8.4.4 operation: 1. Set IP address, Gateway nano/
Note:
The system i
Http://www.knowsky.com/383893.html
Subnet Mask, the concept and working principle of the gateway and ARP Protocol are several important knowledge points that Beginners first encounter when learning network knowledge, among them, the role and basic working principle of subnet mask
-eth0 and modify the IP
[Aeolus @ db1 network-Scripts] $ VI ifcfg-eth0
Device = eth0 device name
Onboot = yes whether the NIC is activated when the computer is started
Bootproto = static method for obtaining IP addresses,
Ipaddr = 192.168.2.111 IP Address
Netmask = 255.255.255.0
This technique is very useful for friends who often use laptops for business trips, such as in another environment, such as the customer's company, you always need to change the network to someone else's intranet address, gateway, DNS, and so on. Write a batch processing file, and then change it to the next one. It's faster than the mouse operation.
Form: http:/
= 12.168.1.2 # If you set the method for obtaining the IP address from the NIC to static, This field specifies the IP address of the NIC.IPV6INIT = noIPV6_AUTOCONF = noNETMASK = 255.255.255.0 # network mask corresponding to the network adapterNETWORK = 192.168.1.0 # NETWORK
1.1. Set the IP address, gateway, and DNSRHEL7 inside the network card naming method from the eth0,1,2 way into the enoxxxxx format. En stands for enthernet (Ethernet), O stands for onboard (built-in), and that number is automatically generated by an index number of the motherboard to ensure its uniqueness. Compared with the original naming method, this new way i
I always forget the location of these configuration files and mark them for easy access.1. Modify the IP addressModify the configuration file of the corresponding Nic IP Address# Vi/etc/sysconfig/network-scripts/ifcfg-eth0Modify the following contentDEVICE = eth0 # describe the DEVICE alias for the NIC, for example, it is eth0 in the ifcfg-eth0 FileBOOTPROTO = st
Note: System: debian6.0.4IP address: 192.168.21.166 subnet mask: 255.255.255.0 Gateway: 192.168.21.2DNS: 8.8.8.88.8.4.4 operation: System O M reminder: qihang01 original content copyright, reprinted, please indicate the source and original article links 1. set the IP
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.