查看: 155|回复: 0

[Ubuntu] Ubuntu网络network eth0配置 | ubuntu network configuration

[复制链接]

0

主题

0

回帖

0

积分

热心网友

金币
0
阅读权限
220
精华
0
威望
0
贡献
0
在线时间
0 小时
注册时间
2010-11-5
发表于 2019-11-11 14:52:00 | 显示全部楼层 |阅读模式

本文首发于个人博客https://kezunlin.me/post/5076bc45/,欢迎阅读!

ubuntu network configuration

Guide

network proxy

  • System wide: Network--->None/Manual
  • chrome: can not set
  • firefox: about:preferences---> Network Proxy

eth0 config

rename xxx to eth0

errors may occur:

Ubuntu networking restart | cannot find device 'eth0'

check eth0

$ dmesg | grep eth 

[5.715564] e1000 0000:02:01.0 eth0: (PCI:66MHz:32-bit) 00:0c:29:7d:bf:43
[5.715573] e1000 0000:02:01.0 eth0: Intel(R) PRO/1000 Network Connection
[5.719709] e1000 0000:02:01.0 ens33: renamed from eth0

and we get ens33 renamed from eth0, we need to change it back to eth0.

solution

(1). edit grub and update

$ sudo vim /etc/default/grub

#GRUB_CMDLINE_LINUX=""
GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0"

$ sudo update-grub

(2) edit network interfaces

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 192.168.1.77 
netmask 255.255.255.0
gateway 192.168.1.1 

(3) reboot

sudo reboot now

(4) check eth0

$ sudo ifconfig

eth0      Link encap:Ethernet  HWaddr 80:fa:5b:47:92:8a  
          inet addr:192.168.1.77  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

lo        Link encapocal Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:4640 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4640 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:865530 (865.5 KB)  TX bytes:865530 (865.5 KB)

wlan0     Link encap:Ethernet  HWaddr b0:35:9f:53:68:c6  
          inet addr:192.168.0.130  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::a3d7:e190:6fb3:133/64 Scopeink
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:6536 errors:0 dropped:0 overruns:0 frame:0
          TX packets:380 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:581427 (581.4 KB)  TX bytes:46439 (46.4 KB)

OK. Now we get eth0,wlan0 properly set.

Reference

  • ubuntu rename eth0

History

  • 20180108: created
  • 20180222: add eth0 part.

Copyright

  • Post author: kezunlin
  • Post link: https://kezunlin.me/post/5076bc45/
  • Copyright Notice: All articles in this blog are licensed under CC BY-NC-SA 3.0 unless stating additionally.


来源:https://www.cnblogs.com/kezunlin/p/11834841.html
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

圆梦公社,专注于为全球华人提供纯粹技术交流的地方,请勿发布任何政治及违法的言论。如有相关侵权、举报、投诉及建议等,请发 E-mail:dzh188@hotmail.com

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部