开启虚拟机
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
登录:
修改ip:
vi /etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE=eth0TYPE=Ethernet#需要修改ONBOOT=yesNM_CONTROLLED=yes#需要修改BOOTPROTO=staticDEFROUTE=yesPEERDNS=yesPEERROUTES=yesIPV4_FAILURE_FATAL=yesIPV6INIT=noNAME="System eth0"#需要修改IPADDR=192.168.44.31NETMASK=255.255.255.0GATEWAY=192.168.44.2DNS1=8.8.8.8
修改mac地址
vi /etc/udev/rules.d/70-persistent-net.rules # PCI device 0x8086:0x100f (e1000)SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:8f:0e:09", ATTR{type}=="1", KERNEL=="eth*", #需要修改 如果是eth0 则不用修改NAME="eth0"
修改主机名
vi /etc/sysconfig/networkNETWORKING=yes#需要修改HOSTNAME=mysqlMachine
域名映射
vi /etc/hosts 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4::1 localhost localhost.localdomain localhost6 localhost6.localdomain6192.168.44.31 mysqlMachine
windows系统域名映射
修改C:\Windows\System32\drivers\etc\hosts,用记事本打开,在最下方加上
192.168.44.31 mysqlMachine
用SecureCRT连接的时候就可以不用写ip了:
关闭虚拟机防火墙
chkconfig iptables off //下次开机后永久关闭防火墙service iptables stop //临时关闭防火墙