Ubuntu 16.04 Core VM VirtualBox ปัญหาเครือข่ายภายใน


1

ในไฟล์ / etc / network / interfaces ฉันเปลี่ยนอะแดปเตอร์จากปกติ

auto enp0s3 iface enp0s3 inet dhcp

ไปยัง

auto enp0s8 iface enp0s8 inet static address 172.16.9.2 netmask 255.255.255.0 network 172.16.9.0 gateway 172.16.9.1 broadcast 172.16.9.255 dns-namedservers 8.8.8.8 8.8.4.4

ดังนั้นสิ่งนี้ควรเปลี่ยน enp0s3 เป็น enp0s8 โดยอัตโนมัติด้วยการกำหนดค่าภายในที่เหมาะสมสำหรับเครือข่าย ฉันได้สิ่งนี้แทนเมื่อฉันip a

2 enp0s3:<the usual broadcast multimask......> link/ether <mac that ive changed so many times now> brd ffff:ff:ff:ff:ff

ฉันรีบูตเครื่องหลายครั้งไม่มีอะไร

เพิ่มในไฟล์ที่เรียกว่า/etc/udev/rules.d/10-rename-network.rulesหนึ่งบรรทัดนี้SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="<whatever ive changed the mac addr to>", NAME="enp0s8"

สำหรับ vms อื่น ๆ ของฉันการเพิ่มไฟล์และหนึ่งบรรทัดทำงานและเปลี่ยน enp0s3 เป็น enp0s8 และอนุญาตให้ฉันพูดคุยผ่านเครือข่ายภายในของฉันได้อย่างถูกต้อง ครั้งนี้มันไม่ใช่ ข้อเสนอแนะใด ๆ เกี่ยวกับสิ่งที่ฉันสามารถทำได้?

คำตอบ:


0

คุณอาจลองพารามิเตอร์อื่น ๆ ตามที่ระบุไว้ในlinuxfromscratch.org

ฉันจะใช้/etc/udev/rules.d/70-persistent-net.rulesชื่อไฟล์ที่แนะนำและฉันจะลองพารามิเตอร์เพิ่มเติมทั้งสองนี้:

  1. DRIVERS=="?*"
  2. ATTR{type}=="1"

ในไคลเอนต์ VirtualBox ของฉัน (Ubuntu 16.04) การเพิ่มไฟล์/etc/udev/rules.d/70-persistent-net.rulesด้วย: SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:27:eb:4d:96", ATTR{dev_id}=="0x0", ATTR{type}=="1", NAME="enp0s8"ทำงานตามที่คาดไว้

user@osgeolive:~$ ifconfig -a enp0s8 Link encap:Ethernet HWaddr 08:00:27:eb:4d:96
inet addr:10.0.2.15 Bcast:10.0.2.255 Mask:255.255.255.0 inet6 addr: fe80::fc61:f35a:4e30:aecc/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:30 errors:0 dropped:0 overruns:0 frame:0 TX packets:37 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:4535 (4.5 KB) TX bytes:3532 (3.5 KB)

โดยการใช้ไซต์ของเรา หมายความว่าคุณได้อ่านและทำความเข้าใจนโยบายคุกกี้และนโยบายความเป็นส่วนตัวของเราแล้ว
Licensed under cc by-sa 3.0 with attribution required.