Categories
技术讨论

配置ubuntu的网络

笔记

临时改变ip地址,重启后恢复

$sudo ifconfig eth0 192.168.10.20 netmask 255.255.255.0

设置静态ip地址,修改/etc/network/interfaces文件

auto eth0
iface eth0 inet static
address 192.168.10.20
netmask 255.255.255.0
gateway 192.168.10.1

设置dhcp分配ip地址,修改/etc/network/interfaces文件

auto eth0
iface eth0 inet dhcp

重启所有网络

$sudo /etc/init.d/networking restart

禁用/重启指定网卡

$sudo ifdown eth0

$sudo ifup eth0

1 reply on “配置ubuntu的网络”

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.