Linux设置方法
图形化方法:
Centos7/Redhat7 nmcli
Centos6/Redhat6 setup
[root@note61 ~]# cd /etc/sysconfig/network-scripts/
[root@note61 network-scripts]# vim ifcfg-eth0
DEVICE=eth0
TYPE=Ethernet
ONBOOT=yes
BOOTPROTO=dhcp
HWADDR=00:0c:29:37:ff:03
DEVICE=eth0
TYPE=Ethernet
ONBOOT=yes
BOOTPROTO=none/static
IPADDR=192.168.109.130
NETMASK=255.255.255.0
DNS1=192.168.109.25 #7使用这种方法配置DNS,6写入到/etc/resolv.conf
GATEWAY=192.168.109.254
1. 查看
route -n
2. 添加
route add -net 9.123.0.0 netmask 255.255.0.0 gw 9.123.0.1
3. 删除
route del -net 9.123.0.0 netmask 255.255.0.0 gw 9.123.0.1
原文链接:https://www.f2er.com/centos/378542.html