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

来自ARM Wiki
跳转至: 导航搜索
第48行: 第48行:
 
</syntaxhighlight>
 
</syntaxhighlight>
 
::* 查看目前使用的DNS服务
 
::* 查看目前使用的DNS服务
</syntaxhighlight>
+
:::<syntaxhighlight lang="bash" line>
 
sudo apt install dnsutils
 
sudo apt install dnsutils
 
nslookup www.baidu.com
 
nslookup www.baidu.com
 +
</syntaxhighlight>
 
:::[[File:DNS.png|frameless|650px|DNS]]
 
:::[[File:DNS.png|frameless|650px|DNS]]

2020年5月20日 (三) 17:21的版本

  • 硬件
  • 默认网卡硬件为
    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服务
1 sudo apt install dnsutils
2 nslookup www.baidu.com
DNS