请教一个vm linux网络设置的问题?

ronnie_147 2012-06-02 12:50:22
我在vm上装了ubuntu 12,现在想用ssh连上虚拟机进行操作。但是总是连不上,不知道怎么设置网络

我在本机上用ifconfig/all得到的信息如下:


Windows IP Configuration Host Name . . . . . . . . . . . . : S3X2NABI2EFCO6B Primary Dns Suffix . . . . . . . : Node Type . . . . . . . . . . . . : Unknown IP Routing Enabled. . . . . . . . : Yes WINS Proxy Enabled. . . . . . . . : No Ethernet adapter VMware Network Adapter VMnet8: Connection-specific DNS Suffix . : Description . . . . . . . . . . . : VMware Virtual Ethernet Adapter for VMnet8 Physical Address. . . . . . . . . : 00-50-56-C0-00-08 Dhcp Enabled. . . . . . . . . . . : No IP Address. . . . . . . . . . . . : 192.168.241.1 Subnet Mask . . . . . . . . . . . : 255.255.255.0 Default Gateway . . . . . . . . . : Ethernet adapter VMware Network Adapter VMnet1: Connection-specific DNS Suffix . : Description . . . . . . . . . . . : VMware Virtual Ethernet Adapter for VMnet1 Physical Address. . . . . . . . . : 00-50-56-C0-00-01 Dhcp Enabled. . . . . . . . . . . : No IP Address. . . . . . . . . . . . : 192.168.109.1 Subnet Mask . . . . . . . . . . . : 255.255.255.0 Default Gateway . . . . . . . . . : Ethernet adapter 本地连接: Connection-specific DNS Suffix . : Description . . . . . . . . . . . : Realtek PCIe FE Family Controller Physical Address. . . . . . . . . : 00-E0-4C-08-57-79 Dhcp Enabled. . . . . . . . . . . : No IP Address. . . . . . . . . . . . : 0.0.0.0 Subnet Mask . . . . . . . . . . . : 0.0.0.0 Default Gateway . . . . . . . . . : PPP adapter 宽带连接: Connection-specific DNS Suffix . : Description . . . . . . . . . . . : WAN (PPP/SLIP) Interface Physical Address. . . . . . . . . : 00-53-45-00-00-00 Dhcp Enabled. . . . . . . . . . . : No IP Address. . . . . . . . . . . . : 10.0.0.63 Subnet Mask . . . . . . . . . . . : 255.255.255.255 Default Gateway . . . . . . . . . : 10.0.0.63 DNS Servers . . . . . . . . . . . : 202.96.134.133 202.96.128.86 NetBIOS over Tcpip. . . . . . . . : Disabled


ubuntu上ifconfig得到的信息:


ronnie@ubuntu:~$ ifconfig eth0 Link encap:Ethernet HWaddr 00:0c:29:c6:4f:1d inet addr:192.168.241.128 Bcast:192.168.241.255 Mask:255.255.255.0 inet6 addr: fe80::20c:29ff:fec6:4f1d/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:8640 errors:0 dropped:0 overruns:0 frame:0 TX packets:262 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:641991 (641.9 KB) TX bytes:53205 (53.2 KB) Interrupt:19 Base address:0x2000 lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:470 errors:0 dropped:0 overruns:0 frame:0 TX packets:470 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:37292 (37.2 KB) TX bytes:37292 (37.2 KB)


虚拟机的网络类型现在是设成NAT,请问该如何配置,谢谢!
...全文
128 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
root_jli 2012-06-05
  • 打赏
  • 举报
回复
ssh连不上虚拟机,先看是网络的问题,还是ssh的问题
1、检查宿主机与虚拟机网络
你的主机是win 使用“ipping 虚拟机ip”
2、如果能ping 通,检查虚拟机ssh服务是否启动,端口是否打开
ps aux|grep ssh|grep -v grep
netstat -ant |grep 22
daviddb7 2012-06-05
  • 打赏
  • 举报
回复
3楼的怎么只有IPV6,没看见V4的地址啊
再一个,先ping下,如果能通,就可以确认网络没有问题了。
然后才是SSHD的配置
疯疯癫癫 2012-06-05
  • 打赏
  • 举报
回复
我用的就是NAT啊。对了,楼主,你看看是不是你把VMware的服务禁止了
[Quote=引用 2 楼 的回复:]
NAT不行噢, 必须桥接.
[/Quote]
ronnie_147 2012-06-02
  • 打赏
  • 举报
回复
csdn的编辑器怎么不自动换行啊
qq120848369 2012-06-02
  • 打赏
  • 举报
回复
桥接, 配置虚拟机网卡和你的XP网卡在同一个网段内噢.
ronnie_147 2012-06-02
  • 打赏
  • 举报
回复
linux白痴跪求各路大神帮忙
ronnie_147 2012-06-02
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 的回复:]

NAT不行噢, 必须桥接.
[/Quote]

我改成了桥连,还是连不上

eth0 Link encap:Ethernet HWaddr 00:0c:29:c6:4f:1d
inet6 addr: fe80::20c:29ff:fec6:4f1d/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:2475 errors:0 dropped:0 overruns:0 frame:0 TX packets:100 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:163308 (163.3 KB) TX bytes:20140 (20.1 KB) Interrupt:19 Base address:0x2000
qq120848369 2012-06-02
  • 打赏
  • 举报
回复
NAT不行噢, 必须桥接.

23,121

社区成员

发帖
与我相关
我的任务
社区描述
Linux/Unix社区 应用程序开发区
社区管理员
  • 应用程序开发区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧