Proxmox VE 物理环境修改后配置联网

书接上回

因为某个不明驱动的原因导致Proxmox VE不能直接安装

so曲线救国,先在服务器上安装好了之后再放到笔记本上运行

但是网就连不上了

因为网卡变了呀,咋办呢

已知:

  1. 服务器上有两个有线网卡
  2. 笔记本上有一个有线网卡和一个无线网卡
  3. Proxmox VE安装时设置的ip是192.168.10.200

ip addr看一下网络信息

root@pve:~# ip addr
1: lo:  mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: enp0s25:  mtu 1500 qdisc pfifo_fast master vmbr0 state UP group default qlen 1000
    link/ether 00:1e:37:84:71:8f brd ff:ff:ff:ff:ff:ff
3: wls3:  mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 00:1d:e0:85:0e:75 brd ff:ff:ff:ff:ff:ff
4: vmbr0:  mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 00:1e:37:84:71:8f brd ff:ff:ff:ff:ff:ff
    inet 192.168.20.226/23 brd 192.168.10.200 scope global vmbr0
       valid_lft forever preferred_lft forever
    inet6 fe80::21e:37ff:fe84:718f/64 scope link 
       valid_lft forever preferred_lft forever

哦现在有两个物理网卡enp0s25和wls3,对应笔记本的硬件,前面的是有线网卡,后面的是无线网卡

再看一下登录时打印的信息

Last login: Sun May 12 16:28:32 CST 2019 on pts/0
Linux pve 4.15.18-12-pve #1 SMP PVE 4.15.18-35 (Wed, 13 Mar 2019 08:24:42 +0100) x86_64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.

哦基于Debian的啊

那直接找/etc/network/interfaces这个文件

auto lo
iface lo inet loopback

iface eno1 inet manual

auto vmbr0
iface vmbr0 inet static
        address 192.168.10.200
        netmask 255.255.255.0
        gateway 192.168.10.1
        bridge_ports eno1
        bridge_stp1 off
        bridge_fd 0

iface eno2 inet static

结合前面ip addr打印的内容可以得出:

  1. 之前服务器有两个网卡,分别叫eno1和eno2
  2. 笔记本也有两个网卡,分别叫enp0s25和wls3,前面的是有线网卡,后面的是无线网卡,这里我们只用有线网卡
  3. Proxmox VE中并不是直接对物理网卡进行配置,而是通过vmbr0这一个虚拟网卡桥接到物理网卡上,然后对虚拟网卡进行配置的

so,将/etc/network/interfaces这个文件中的内容修改为

auto lo
iface lo inet loopback

iface enp0s25 inet manual

auto vmbr0
iface vmbr0 inet static
        address 192.168.10.200
        netmask 255.255.255.0
        gateway 192.168.10.1
        bridge_ports enp0s25
        bridge_stp1 off
        bridge_fd 0

然后/etc/init.d/networking restart重启网络 重启网络,完事


关联一篇文章虚拟机(服务器)配置双网卡实现内外网同时访问

你可能感兴趣的:(学与玩,双手成就梦想)