在家配置网络

配置网络,主要涉及到etc下的文件。

resolv.conf是nameserver,就是DNS。

network下的interfaces是配置eth0的信息的。还有lo的信息。

ifconfig eth0 up /down的命令,不能重新启动网络。

init.d下的network 命令,可以启动网络。

network restart命令就行。


root@ubuntu:/etc/init.d# ./networking restart

 * Reconfiguring network interfaces...                                                                                                                  RTNETLINK answers: No such process
SIOCDELRT: No such process
                                                                                                                                                 [ OK ]
root@ubuntu:/etc/init.d# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:0c:29:da:ff:a7  
          inet addr:192.168.1.20  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:feda:ffa7/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1727 errors:0 dropped:0 overruns:0 frame:0
          TX packets:116 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:162017 (162.0 KB)  TX bytes:5681 (5.6 KB)
          Interrupt:19 Base address:0x2024 


lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:5198 errors:0 dropped:0 overruns:0 frame:0
          TX packets:5198 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:399506 (399.5 KB)  TX bytes:399506 (399.5 KB)


root@ubuntu:/etc/init.d# 
root@ubuntu:/etc/init.d# ping www.163.com
PING 163.xdwscache.glb0.lxdns.com (60.210.18.169) 56(84) bytes of data.
64 bytes from 60.210.18.169: icmp_seq=1 ttl=58 time=9.74 ms
64 bytes from 60.210.18.169: icmp_seq=2 ttl=58 time=9.42 ms
64 bytes from 60.210.18.169: icmp_seq=3 ttl=58 time=9.89 ms
64 bytes from 60.210.18.169: icmp_seq=4 ttl=58 time=9.88 ms
64 bytes from 60.210.18.169: icmp_seq=5 ttl=58 time=9.51 ms
64 bytes from 60.210.18.169: icmp_seq=6 ttl=58 time=9.36 ms
64 bytes from 60.210.18.169: icmp_seq=7 ttl=58 time=9.77 ms
64 bytes from 60.210.18.169: icmp_seq=8 ttl=58 time=9.44 ms
64 bytes from 60.210.18.169: icmp_seq=9 ttl=58 time=10.0 ms
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

等风来不如迎风去

你的鼓励是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值