ChinaUnix.net
相关文章推荐:

linux获取MAC

想用ifconfig 命令,但没有找到软件包,请问ifconfig 是在那个软件报 还有通过编程也可以或得mac, 还有mac会不会记录在某个文件下呢

by linuxer_rh - Linux论坛 - 2004-06-21 16:06:30 阅读(916) 回复(3)

相关讨论

大家好,我使用openvpn-2.0.9版本 我使用的是网关到网关的连接方式 但是我发现有时候两个做客户端的网关获取到的 tap0接口的mac地址是一样的, 这是两个客户端网关都能和服务器端通,但是两个客户端网关之间是不通的 有时候获取到的tap0接口的mac地址又是不一样的 想请问一下这个 tap0接口的mac地址是随机的还是在一个范围里面分配的 我看到2.1的openvpn版本好像里面有 个lladdr选项是可以直接指定mac地址的,但是2.0.9上是...

by cltnet - 服务器应用 - 2009-05-18 21:09:48 阅读(5148) 回复(12)

做了一个linux下的SOCKET程序,基于TCP协议,当有别的计算机访问的时候,服务器端要怎么获得访问者的IP和mac地址?

by shineyear - C/C++ - 2008-10-08 10:41:26 阅读(19714) 回复(15)

如何在linux bridge 中通过mac地址获取到IP地址呢? 类似于在线状态用户功能的实现

by yangfan40207 - 网络技术 - 2008-10-28 18:03:16 阅读(6391) 回复(9)

代码如下: [code] #include //#include #include #include #include #include #include #include #include #include #include #include #include #include int main(int argc, char **argv) { int sockfd; char *ptr; struct ...

by amoyppa - C/C++ - 2013-03-22 16:36:51 阅读(6912) 回复(7)

是要获取同一个子网的另一台主机的,不是本地的。

by yy_unicorn - 内核/嵌入技术 - 2006-10-11 09:53:47 阅读(1224) 回复(7)

Red Hat linux Advanced Server release 2.1AS/i686 (Pensacola) 重起系统后使用 ifconfig -a 发现两块网卡mac地址变为0 如下:ifconfig -a eth0 Link encap:Ethernet HWaddr 00:00:00:00:00:00 inet addr:192.168.20.217 Bcast:192.168.20.255 Mask:255.255.255.128 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:341648 errors:321953 dropped:0 overruns:0 fram...

by black duck - Linux论坛 - 2005-04-10 11:48:41 阅读(953) 回复(7)

一个示例脚本: import os import re def Getmac(): if os.name == 'nt': try: ret = '' CmdLine = 'ipconfig /all' r = os.popen(CmdLine).read() if r: L = re.findall('Physical Address.*?([0-9,A-F]{2}-[0-9,A-F]{2}-[0-9,A-F]{2}-[0-9,A-F]{2}-[0-9,A-F]{2}-[0-9,A-F]{2})', r) if len(L) > 0: ret =...

by zhaohang3031 - Python文档中心 - 2009-07-20 12:09:37 阅读(2754) 回复(1)

/** * 获取网卡mac地址 */ public static String getmacOnWindow() { try { String mac = null; Process process = Runtime.getRuntime().exec("ipconfig /all"); BufferedReader buffer = new BufferedReader(new InputStreamReader(process.getInputStream())); for (String line = buffer.readLine(); line != null; line = buf...

by sunwei0325 - Java文档中心 - 2008-07-30 11:18:35 阅读(1372) 回复(0)

在同一子网内获取另一台主机的mac地址较为容易,发送arp请求并接收应答就可以得到,如果跨网段的话(路由器或者3层交换机划分的vlan),有没有一种方法获取对方的mac地址?

by Thinkor - 网络技术 - 2006-05-26 17:54:06 阅读(2497) 回复(9)

获取mac: # fping -g 192.168.0.1 192.168.0.255 # 指定一个地址范围 # arp -na # ip跟mac 就是这么简单. :m01:

by congli - BSD - 2005-10-30 00:12:41 阅读(1796) 回复(7)