目录
前言
一、关闭防火墙
二、关闭selinux安全子系统
三、桥接模式
? ? 1、使用场景
? ? 2、虚拟机设置,选择桥接模式
? ? 3、进入虚拟网络编辑器
? ? 4、命令过程
四、NAT模式
? ? 1、使用场景
? ?? 2、?虚拟机设置,选择NAT模式
? ? ?3、DHCP下进入虚拟网络编辑器?
? ? ?4、命令
?? ? ?5、静态 static下进入虚拟网络编辑器
? ? ?6、命令
五、仅主机模式
? ? 1、使用场景
? ? ?2、?虚拟机设置,选择仅主机模式
? ? ?3、进入虚拟网络编辑器
? ? ?4、命令
六、ping命令
总结
前言
? ? ? ?当开始Linux系统时,首先我们要选择好网络连接方式。Linux有三种连接方式:桥接模式、NAT模式、仅主机模式。
一、关闭防火墙

二、关闭selinux安全子系统
? ? ? 防止导致文件打不开


三、桥接模式
? ? 1、使用场景
? ? ? ?这种模式下,虚拟机就像是局域网中的一台独立的主机,可以和主机一样,访问网内任何一台机器。
? ? 2、虚拟机设置,选择桥接模式

? ? 3、进入虚拟网络编辑器

?
? ? ?4、命令过程



?
四、NAT模式
? ? ?1、使用场景
? ? ? ? 可以在虚拟系统里访问互联网
? ? ? 2、?虚拟机设置,选择NAT模式

? ? ? 3、DHCP下进入虚拟网络编辑器

? ? ? ?4、命令
? ? ? 5、静态 static下进入虚拟网络编辑器
? ? ??
? ? ? 6、命令

?
?
五、仅主机模式
? ? 1、使用场景
? ? ? ?虚拟机只能与虚拟机、主机互访,不能上网
? ? ?2、?虚拟机设置,选择仅主机模式
?
? ? ?3、进入虚拟网络编辑器

? ? ?4、命令
?
?
?
六、ping命令
? ? 1、#-c 表示指定ping的次数,如ping -c 5 192.168.1.1,表示ping5次
? ? ?2、#-i 秒数:设定间隔几秒送一个网络封包给一台机器,预设值为1秒1次
? ? ?3、#-w 表示ping的超时时间为5秒,意思是只ping5秒,5秒后结束
总结
? ? ? ?在三种模式中,NAT模式是最简单,基本不需要手动配置IP地址,常常被使用。
|