snull试验操作

[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
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值