页面“C语言常见错误”与“Debian配置网络”之间的差异

来自linux中国网wiki
(页面间的差异)
跳到导航 跳到搜索
docker>Evan
(创建页面,内容为“==GCC编译已经引入math.h文件提示cos,sin等函数未定义== 编译时加 -lm category:c”)
 
docker>Evan
 
第1行: 第1行:
==GCC编译已经引入math.h文件提示cos,sin等函数未定义==
+
<pre>
编译时加 -lm
+
cat  /etc/network/interfaces
 +
# This file describes the network interfaces available on your system
 +
# and how to activate them. For more information, see interfaces(5).
  
[[category:c]]
+
source /etc/network/interfaces.d/*
 +
 
 +
# The loopback network interface
 +
auto enp0s3 # #设置开机自动连接网络
 +
allow-hotplug enp0s3
 +
iface enp0s3 inet static #static表示使用固定IP地址上网,dhcp表示使用动态ip
 +
address 192.168.88.3  #设置静态ip地址
 +
netmask 255.255.255.0 #子网掩码
 +
gateway 192.168.88.1  #网关
 +
 
 +
auto lo
 +
iface lo inet loopback
 +
 
 +
#重启网络不成功
 +
service networking restart
 +
 
 +
</pre>
 +
 
 +
=my eg=
 +
<pre>
 +
# The primary network interface
 +
auto enp0s3
 +
allow-hotplug enp0s3
 +
iface enp0s3 inet static
 +
address 192.168.88.68
 +
netmask 255.255.255.0
 +
gateway 192.168.88.1
 +
 
 +
auto lo
 +
iface lo inet loopback
 +
 
 +
</pre>
 +
=参考=
 +
[https://www.debian.cn/archives/1246 Debian中如何设置静态IP地址 ]
 +
 
 +
[http://www.voidcn.com/article/p-youlbtpa-bqt.html debian9.x配置网络]
 +
  [[category:ops]]

2019年5月24日 (五) 08:04的版本

 cat  /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto enp0s3 # #设置开机自动连接网络
allow-hotplug enp0s3
iface enp0s3 inet static #static表示使用固定IP地址上网,dhcp表示使用动态ip
address 192.168.88.3  #设置静态ip地址
netmask 255.255.255.0 #子网掩码
gateway 192.168.88.1  #网关

auto lo
iface lo inet loopback

#重启网络不成功
service networking restart

my eg

# The primary network interface
auto enp0s3
allow-hotplug enp0s3
iface enp0s3 inet static 
address 192.168.88.68 
netmask 255.255.255.0 
gateway 192.168.88.1 

auto lo
iface lo inet loopback

参考

Debian中如何设置静态IP地址

debian9.x配置网络