“模板:Ethernet”的版本间的差异

来自ARM Wiki
跳转至: 导航搜索
(创建页面,内容为“<div style="display:none;"> * '''硬件''' ::* 默认网卡硬件为<pre style="color: red">AR8033 PHY芯片</pre> ::* 若为双网卡板卡,则另一个芯片为R...”)
 
(未显示同一用户的4个中间版本)
第18行: 第18行:
 
allow-hotplug eth0
 
allow-hotplug eth0
 
auto eth0
 
auto eth0
iface eth0 inet dhcp
+
iface eth0 inet dhcp             //动态IP模式
  
 
EOF
 
EOF
第29行: 第29行:
 
allow-hotplug eth0
 
allow-hotplug eth0
 
auto eth0
 
auto eth0
iface eth0 inet static
+
iface eth0 inet static           //静态IP模式
address 192.168.8.55
+
address 192.168.8.55             //静态IP地址
netmask 255.255.255.0
+
netmask 255.255.255.0             //子网掩码
gateway 192.168.8.1
+
gateway 192.168.8.1               //网关
dns-nameservers 202.96.134.133
+
dns-nameservers 202.96.134.133   //DNS域名服务器
  
 
EOF
 
EOF
 
</syntaxhighlight>
 
</syntaxhighlight>
 
:::[[File:静态IP.png|frameless|650px|静态IP]]
 
:::[[File:静态IP.png|frameless|650px|静态IP]]
 +
 +
::* DNS设置
 +
:::<syntaxhighlight lang="bash" line>
 +
cat <<EOF > /etc/resolv.conf      //interfaces配置文件的优先级大于此文件,配置静态IP时设置DNS会让此文件失效
 +
nameserver 8.8.8.8                //主DNS
 +
nameserver 114.114.114.114        //副DNS
 +
 +
EOF
 +
</syntaxhighlight>
 +
:::[[File:DNS.png|frameless|650px|DNS]]

2020年5月20日 (三) 14:54的版本

  • 硬件
  • 默认网卡硬件为
    AR8033 PHY芯片
  • 若为双网卡板卡,则另一个芯片为RTL8211F
  • 查看设备
  • 查看所有设备列表
1 ip link show | grep -i "eth"
网卡设备
  • 使用
  • 动态IP
1 cat <<EOF >> /etc/network/interfaces
2 allow-hotplug eth0
3 auto eth0
4 iface eth0 inet dhcp              //动态IP模式
5 
6 EOF
动态IP
  • 静态IP
 1 cat <<EOF >> /etc/network/interfaces
 2 allow-hotplug eth0
 3 auto eth0
 4 iface eth0 inet static            //静态IP模式
 5 address 192.168.8.55              //静态IP地址
 6 netmask 255.255.255.0             //子网掩码
 7 gateway 192.168.8.1               //网关
 8 dns-nameservers 202.96.134.133    //DNS域名服务器
 9 
10 EOF
静态IP
  • DNS设置
1 cat <<EOF > /etc/resolv.conf      //interfaces配置文件的优先级大于此文件,配置静态IP时设置DNS会让此文件失效
2 nameserver 8.8.8.8                //主DNS
3 nameserver 114.114.114.114        //副DNS
4 
5 EOF
DNS