linux修改IP和DNS

linux修改IP和DNS

配置文件路径/etc/network/interface

# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
 
# The loopback interface
auto lo
iface lo inet loopback

# Wireless interfaces
iface wlan0 inet dhcp
    wireless_mode managed
    wireless_essid any
    wpa-driver wext
    wpa-conf /etc/wpa_supplicant.conf

iface atml0 inet dhcp

# Wired or wireless interfaces
auto eth0
#iface eth0 inet dhcp
#iface eth1 inet dhcp
iface eth0 inet static
    address 192.168.1.232
    netmask 255.255.255.0
    gateway 192.168.1.1
    broadcast 192.168.1.255
    dns-nameservers 223.5.5.5

#auto eth1
#iface eth1 inet static
#address 192.168.1.232
#netmask 255.255.255.0
#gateway 192.168.1.1
#broadcast 192.168.1.255

# Ethernet/RNDIS gadget (g_ether)
# ... or on host side, usbnet and random hwaddr
iface usb0 inet static
    address 192.168.7.2
    netmask 255.255.255.0
    network 192.168.7.0
    gateway 192.168.7.1

# Bluetooth networking
iface bnep0 inet dhcp

转载请注明来源,欢迎对文章中的引用来源进行考证,欢迎指出任何有错误或不够清晰的表达。可以在下面评论区评论,也可以邮件至 wind.kaisa@gmail.com

×

喜欢就点赞,疼爱就打赏