# Add non interface-specific static-routes. if[ -f /etc/sysconfig/static-routes]; then grep"^any"/etc/sysconfig/static-routes| whilereadignore args ; do /sbin/routeadd -$args done fi 1. 则,如果要添加一条静态路由,命令为: route add -net 192.56.76.0 netmask 255.255.255.0 dev eth0 1. ...
# nano /etc/sysconfig/network-scripts/route-eth0 The route will get set up when the specified interfaces comes up. This file will probably wont exist if you don’t have any existing static routes. Add a line with the route information in the following format to the file. x.x.x.x/y ...
3.添加udev的规则 (centos7.4 没有了这个文件) 在”/etc/udev/rules.d“目录中创建一个网卡规则”70-persistent-net.rules“,并写入下面的语句: SUBSYSTEM=="net",ACTION=="add",DRIVERS=="?*",ATTR{address}=="00:0c:29:1e:a3:77",ATTR{type}=="1" ,KERNEL=="eth*",NAME="eth0" #ATTR{addr...
指定本地解析:/etc/hosts:主机IP 主机名 主机别名【172.16.0.1www.magedu.com www】Iproute2命令【ifconfig老旧】link: 网络接口属性、addr: 协议地址、route: 路由 link show 【ip -slink show eth0】等价于ifconfig eth0 set【ip link set DEV {up|down}】启动网卡 addr add【ip addr a...
# route add default gw 192.168.0.1 dev eth0 启动生效: 修改/etc/sysconfig/network 修改DNS 修改/etc/resolv.conf 修改后可即时生效,启动同样有效 修改host name 即时生效: # hostname centos1 启动生效: 修改/etc/sysconfig/network 修改网卡配置 #vi /etc/udev/rules.d/70-persistent-net.rules上...
0.1 dev eth0启动生效:修改 /etc/sysconfig/network 修改 DNS修改/etc/resolv.conf修改后可即时生效,启动同样有效 修改 host name即时生效:复制代码代码如下:# hostname centos1启动生效:修改/etc/sysconfig/network 修改网卡配置 复制代码代码如下:#vi /etc/udev/rules.d/70-persistent-net.rules ...
===Persistent Routes:None###添加持久化路由 C:\>route add 172.24.8.0 mask 255.255.255.0 192.168.1.175 -p OK! C:\>route print -4IPv4 Route Table ===Active Routes: Network Destination Netmask Gateway Interface Metric0.0.0.0 0.0.0.0 192.168.1.1 192.168.1.242...
# chkconfig –add mysqld #添加LIB PATH echo “/usr/local/mysql/lib” >> /etc/ld.so.conf && ldconfig vi /etc/my.cnf 修改MySQL 配置,增加部分优化参数,如下: [mysqld] ft_min_word_len=2 运行以下命令即可启动 MySQL 服务器: # /etc/rc.d/init.d/mysqld start //启动 MySQL ...
四、Windows 10下配置路由 代码语言:javascript 复制 ###当前环境C:\>systeminfo|findstr BuildOSVersion:10.0.14393N/ABuild14393OSBuild Type:Multiprocessor Free ###查看当前的路由信息C:\>route print-4===
手动添加 route add default gw 10.1.6.1 发现可以正常上网 但重启就不行了。 上网搜索,发现只要把多出的网卡信息清除,就可以自动获得网关。 步骤: 删除/etc/udev/rules.d/70-persistent-net.rules 里面多余的网卡信息 删除/etc/sysconfig/network-scripts/ifcfg-eth2 文件 ...