首页天道酬勤linux修改ip命令,linux改固定ip

linux修改ip命令,linux改固定ip

张世龙 05-04 15:57 72次浏览

3358 www.Sina.com/: Linux am 335 x3.2.0# 594 thu oct 1212336016336020 xjt 2017 arm V7 lgnu/Linux

1、查看网卡和ip地址

root@am335x:/# ifconfig

eth0link encap :以太网hwaddr 043360793360 b 7:1 f 336075336072 inetaddr 3360192.168.0.15 bcast 3360192.168.0.15 bcast ASTM tu :1500 metric :1 rx packets 3360813 errors :0 dropped 3360132 over runs 33600 frame 33600 txpacketett 00 ors 3:0 droped 33600 33600 collisions :0 txqueuelen 33601000 rx bytes :71674 (69.9 kib ) tx bytes 336000 et h1 link encap :以太网hwaddr 04360793360 r 336010.10.80.15 bcast 336010.255.255 dcastmtu :1500 metric 33601 rx packets :0 errors :0 dropped :0 over runs :0 frame 00 errors 33600 3600 over runs :0 carrier :0 collisions :0 txqueuelen :1000 rx bytes :0 (0.0b ) tx bytes :0 (0.0b ) ) olink encap : localloopbackinetaddr 3360127.0.0.1 mask :255.0.0.0 uploopbackrunningmtu 336016436 metric :1 rx ptu0DDD 0 tx packets :0 errors :0 dropped :0 over runs :0 carrier :0 collisions 33600 txquuuuuns xbytes :0 (0.0b ) txbytes:0

(1)为静态IP时

root @ am 335 x :/# VI/etc/network /接口

按修改ESC键-输入I-IP :保存为wq-返回

# theloopbackinterfaceautoloifaceloinetloopback #无线wirelessinterfacesifacewlan0inetdhcpwireless _ modemanagedwireless _ essidid wpa _ supplicant.confifacetiwlan0inetdhcpwireless _ modemanagedwireless _ essidanyifaceatml0inet DHCP # wiredorwirelelesintion grep-v-e ' IP=[0-9]\. [0-9]\. [0-9]\.0-9] \ . [0-9] '/proc/cmifaceeth0inetstaticaddress 192.168.1//192.168.1.15网关192.168.1.1//修改为net mask 255.255.255 iface et h1 inetdhcpifaceeth1inetstaticaddress 10.10.80.15网关10.10.80.1 net mask 255.0.0 RndisGaaagant .or on host side,usbnetandrandomhwaddrifaceusb0inet DHCP (2),原为自动配置IP

autoloifaceloinetloopbackautoeth0iface eth0inet DHCP

3、手动设置DNS服务器

打开文件vi /etc/resolv.conf,保存修改内容并退出

name服务器114.114.114.114 name服务器192.168.1.14,重新启动网络服务

/etc/init.d/networking restart

输出功率

root @ am 335 x :/#/etc/init.d/networking restart

reconfiguringnetworkinterfaces . ifdown : misplaced option ' o '

ifup: misplaced option 'o '

道恩。

无效时需要切断电源重新启动

参考: https://www.cn blogs.com/Yao hong/p/9483947.html

ubuntu配置静态ip,kali端口扫描工具