免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 748 | 回复: 0
打印 上一主题 下一主题

snull试验操作 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-12-20 16:03 |只看该作者 |倒序浏览
[root@localhost ~]# insmod snull.o

[root@localhost ~]# dmesg | tail -n1

[root@localhost ~]# vi /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1               localhost.localdomain localhost
192.168.0.88             local0
192.168.0.99             remote0
192.168.1.99             local1
192.168.1.88             remote1

[root@localhost ~]# vi /etc/networks
snullnet0             192.168.0.0         
snullnet1             192.168.1.0      

[root@localhost snull]# ifconfig sn0 local0

[root@localhost snull]# ifconfig sn1 local1

[root@localhost snull]# route add -net snullnet0 netmask 255.255.255.0 sn0

[root@localhost snull]# route add -net snullnet1 netmask 255.255.255.0 sn1
[root@localhost snull]# ifconfig sn0
sn0       Link encap:Ethernet  HWaddr 00:53:4E:55:4C:30  
          inet addr:192.168.0.1  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::253:4eff:fe55:4c30/64 Scope:Link
          UP BROADCAST RUNNING NOARP MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:16 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 b)  TX bytes:2699 (2.6 KiB)
[root@localhost snull]# ifconfig sn1
sn1       Link encap:Ethernet  HWaddr 00:53:4E:55:4C:31  
          inet addr:192.168.1.2  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::253:4eff:fe55:4c31/64 Scope:Link
          UP BROADCAST RUNNING NOARP MULTICAST  MTU:1500  Metric:1
          RX packets:16 errors:0 dropped:0 overruns:0 frame:0
          TX packets:13 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:2699 (2.6 KiB)  TX bytes:2492 (2.4 KiB)
[root@localhost snull]# ping -c 1 remote0
PING remote0 (192.168.0.2) 56(84) bytes of data.
64 bytes from remote0 (192.168.0.2): icmp_seq=1 ttl=64 time=11.4 ms
--- remote0 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 11.468/11.468/11.468/0.000 ms


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u1/53892/showart_446501.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP