ubuntu配置IP地址

1、修改配置文件/etc/network/interfaces

        添加:

                auto eth0                        #设置自动启动eth接口

                iface eth0 inet static       #配置静态IP

                address 192.168.11.88    #IP地址

                netmask 255.255.255.0    #子网掩码

                gateway 192.168.11.1     #默认网关

2、修改DNS配置文件/etc/resolve.conf

        添加:

                nameserver 127.0.0.1

                nameserver 8.8.8.8

3、重启网络,使配置生效。

        sudo /etc/init.d/networking restart

        是否生效可以使用ifconfig查看。

其他:

        路由和网关设置

        route add default gw 192.168.11.1

        route del default

        route -n

        


        

猜你喜欢

转载自blog.csdn.net/xringm/article/details/79847137