Toybrick

标题: rv1126ip怎么修改 [打印本页]

作者: MMMorty    时间: 2021-11-18 14:56
标题: rv1126ip怎么修改
rv1126 ip怎么修改

作者: Xxd    时间: 2022-1-24 23:02
同问我设置成这样不成功
toybrick@debian10:/etc/network$ cat interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)
# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 192.168.0.26
netmask 255.255.255.255.0
gateway 192.168.0.1
auto wlan0
iface wlan0 inet dhcp

toybrick@debian10:/etc/network$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> 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
2: eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 10:dc:b6:90:54:60 brd ff:ff:ff:ff:ff:ff
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN group default qlen 1000
    link/ether 10:2c:6b:10:cb:0c brd ff:ff:ff:ff:ff:ff


作者: Xxd    时间: 2022-1-25 21:19
1、设置IP地址、网关
注意,需要去掉注释才能成功
cp /etc/network/interfaces  /etc/network/interfacesbak   #备份原有配置文件
nano /etc/network/interfaces   #编辑网网卡配置文件
auto lo
auto eth0  #开机自动连接网络
iface lo inet loopback
allow-hotplug eth0
iface eth0 inet static   #static表示使用固定ip,dhcp表述使用动态ip
address 192.168.0.26   #设置ip地址
netmask 255.255.255.0  #设置子网掩码
gateway 192.168.0.1    #设置网关
ctrl+o   #保存配置
ctrl+x   #退出
2、设置dns
cp  /etc/resolv.conf   /etc/resolv.confbak    #备份原有dns配置文件
nano /etc/resolv.conf   #编辑配置文件
nameserver 8.8.8.8   #设置首选dns
nameserver 8.8.4.4   #设置备用dns
ctrl+o   #保存配置
ctrl+x   #退出

3、重启网络
service networking restart   #重启网络
至此,IP地址、网关、DNS配置完成,现在系统已经可以上网了。




欢迎光临 Toybrick (https://t.rock-chips.com/) Powered by Discuz! X3.3