debian配置系统IP 以及多IP多网关通信

debian配置系统IP 以及多IP多网关通信

OWLSAMA
2年前发布

一、IP配置
1、使用命令

    nano /etc/network/interfaces

改为如下

auto eth0
    iface eth0 inet static
    address 192.168.0.190
    gateway 192.168.0.1
    netmask 255.255.255.0
    
    auto eth1
    iface eth1 inet static
    address 192.168.1.190
    gateway 192.168.1.1
    netmask 255.255.255.0

address:IP地址
gateway:网关
netmask:子网掩码
auto eth0:开机自启
iface eth0 inet static: 静态ip

2、配置dns

    nano /etc/resolv.conf

改为如下

    nameserver 114.114.114.114
    nameserver 8.8.8.8

3、重启并应用

    systemctl restart networking

二、多网多网关通信
1、参考linux配置三网同时通信

© 版权声明
THE END
喜欢就支持一下吧
点赞 1 分享 收藏
评论 抢沙发
OωO
取消