侧边栏壁纸
博主头像
TLYAN

只要芝麻,不要西瓜.............纯大神之作
古人有雲:吃得苦中苦方為人上人

  • 累计撰写 112 篇文章
  • 累计收到 5 条评论
ubuntu网卡信息配置记录
2021-01-13 16:23:58 2107阅读 0评论 0点赞

因为ubuntu和centos的网卡名称不一样,所以,首先查询到ubuntu网卡的名称:

在终端输入:ls /proc/sys/net/ipv4/conf 查看网卡名称

sudo vim /etc/network/interfaces

编辑网卡信息如下:

auto eno1 
iface eno1 inet static
address 192.168.1.101
netmask 255.255.0
gateway 192.168.1.1
保存,重启网卡:
/etc/init.d/networking restart
配置SSH server
apt-get install -y openssh-server
允许root登录
vim /etc/ssh/sshd_config
将里面的PermitRootLogin后门的参数改成yes保存
重启ssh service ssh restart即可。

【绑定多IP到网卡】:


auto eth0
iface eth0 inet static
address 192.168.1.10
netmask255.255.255.0
gateway 192.168.1.1
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 8.8.8.8 8.8.4.4
dns-search 7322.libawangluo.com

auto eth0:0
iface eth0:0 inet static
address 192.168.1.11
netmask 255.255.255.0



重启除lo网卡的所有网卡 

ifdown --exclude=lo -a && ifup --exclude=lo -a

版权所有:《小唐博客-唐联艳-我可以告诉你》 => 《ubuntu网卡信息配置记录
本文地址:https://www.tlyan.com/post-71.html
除非注明,文章均为 《小唐博客-唐联艳-我可以告诉你》 原创,欢迎转载!转载请注明本文地址,谢谢。

分享本文至:

扫描二维码,在手机上阅读

评论

取消