========================================================== =============================== Original blog, reprinted please declare the source of Electronic coffee (original id blue rock) ========================================================== ================================
Recently, I encountered a problem when obtaining the Route IP address. On the iPhone, we can see the gateway
This article mainly introduces how to set up the IP floating static route of the router, and provides a schematic diagram and specific command line configuration. The following article will give you a detailed introduction.
Intention: Floating Static Route is used to interconnect the entire network. Normally, R1 sends packets to R3.
From e0/0192.168.12.0), when
Recently, I encountered a problem when obtaining the Route IP address. On the iphone, we can see the gateway address from the settings, but the ios official does not provide an interface to obtain the gateway address.
Finally, I made a demo myself,
However, the problem is that only the
Android obtains the ip address and the physical address of the local machine.
/*** Get ip ** @ return */public static String getLocalIPAddress () {try {for (Enumeration
En = NetworkInterface. getNetworkInterfaces (); en. hasMoreElements ();) {NetworkInterface intf = en.
To set a static IP address for a machine under Linux:
The code is as follows:Vim/etc/sysconfig/network-scripts/ifcfg-eth0
Modify the contents of this file in the following form:
The code is as follows:# Intel Corporation 82541GI Gigabit Ethernet ControllerDevice=eth0Bootproto=static #为静态的Hwaddr=00:15:17:b2:dc:b5Onboot=
Public Static String Getlocalip (){ Try { String Hostname = DNS. gethostname (); // Get the Host Name Iphostentry ipentry = DNS. gethostentry (hostname ); For ( Int I = 0 ; I { // Select an IPv4 IP address from the IP address list. // Addressfamily. Internetwork in
To do this, log in to SSH:Vi/etc/sysconfig/network-scripts/ifcfg-eth0:0The second IP is aVi/etc/sysconfig/network-scripts/ifcfg-eth0:1A third IP is theIfcfg-eth0:2 (from this analogy)Device=eth0:0 NIC device name Onboot=YES random start Bootproto= static statically assigned ipipaddr=*.* . * * the IP
Public static string getlocalip (){Try{String hostname = DNS. gethostname (); // obtain the host name.Iphostentry ipentry = DNS. gethostentry (hostname );For (INT I = 0; I {// Filter IPv4 IP addresses from the IP address list// Addressfamily. Internetwork indicates that the IP
I explained the second-level domain name on the IP address. when the second-level domain name does not allow him to access the address book of the main site, the second-level domain name is edited by liaohongchu from 2012-11-2116:42:50; tm.xinqq163.com nbsp; this is also explained on the IP
I explained the second-level domain name on the IP address. when the second-level domain name does not allow him to access the address book of the main site, the second-level domain name is edited by liaohongchu from 2012-11-2116:42:50; tm.xinqq163.com nbsp; this is also explained on the IP
Public class classnetgetmac{Public classnetgetmac (){}
[Dllimport ("iphlpapi. dll")]Private Static extern int sendarp (int32 DEST, int32 host, byte [] Mac, ref int32 length );[Dllimport ("ws2_32.dll")]Private Static extern int32 inet_addr (string IP );
/// /// Obtain the nic mac address based on the
Want to achieve "record user logon time and exit time, while recording user IP, and to record the user IP corresponding province and City address"
With Session_Start and session_end, implementation is the original idea, the result is not ideal.
The main time is not accurate, can not set the timeout time too short.
Key process:
Create a new ASPX page-spywin.as
I found several methods. After debugging and modification, the following method can be used to obtain the local IP address and MAC address. It can be used to implement this function. It is mainly used to add a reference to system. Management.
Using system; using system. management; using system. net; public class program {st
. tostring ();}MoC = NULL;MC = NULL;Return cpuinfo;}Catch{Return "unknow ";}Finally{}}/// /// Obtain the hardware address of the NIC/// /// String getmacaddress (){Try{// Obtain the hardware address of the NICString MAC = "";Managementclass MC = new managementclass ("win32_networkadapterconfiguration ");Managementobjectcollection MOC = mc. getinstances ();Foreach (managementobject Mo in MoC){If (bool) Mo ["
Update redhat dynamic IP to static IP step1: add gateway vi/etc/sysconfig/network add below "GATEWAY" line NETWORKING = yes NETWORKING_IPV6 = no HOSTNAME = localhost. localdomain GATEWAY = 192.168.1.1 www.2cto.com step2: add your new IP address update dhcp to
Obtain the Client IP Address:
Private string getclientip ()
{
String result = httpcontext. Current. Request. servervariables ["http_x_forwarded_for"];
If (null = Result | result = string. Empty)
{
Result = httpcontext. Current. Request. servervariables ["remote_addr"];
} If (null = Result | result = string. Empty)
{
Result = httpcontext. Current. Request. userhostaddress;
}
Return result;
} Obtain the MAC
We all know that You can bind an IP address and a MAC address directly by running the arp-s command. However, if you cannot run arp-s to bind a static mac address in Win7, the system prompts "ARP entry addition failed: access denied." (The ARP entry addition failed: Access i
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.