- 论坛徽章:
- 19
|
我在CentOS 6.2的实体机下建立了CentOS 6.2的虚拟机
以下分别是实体机的ifconfig和虚拟机的ifconfig
- //此为实体机ifconfig的结果
- # ifconfig
- eth0 Link encap:Ethernet HWaddr 48:5B:39:4F:CD:59
- inet addr:10.2.25.107 Bcast:10.2.25.255 Mask:255.255.254.0
- inet6 addr: 2001:da8:204:1408:4a5b:39ff:fe4f:cd59/64 Scope:Global
- inet6 addr: fe80::4a5b:39ff:fe4f:cd59/64 Scope:Link
- UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
- RX packets:27264 errors:0 dropped:0 overruns:0 frame:0
- TX packets:18838 errors:0 dropped:0 overruns:0 carrier:1
- collisions:0 txqueuelen:1000
- RX bytes:10286805 (9.8 MiB) TX bytes:4310276 (4.1 MiB)
- Interrupt:37
- 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:44557 errors:0 dropped:0 overruns:0 frame:0
- TX packets:44557 errors:0 dropped:0 overruns:0 carrier:0
- collisions:0 txqueuelen:0
- RX bytes:54665891 (52.1 MiB) TX bytes:54665891 (52.1 MiB)
- virbr0 Link encap:Ethernet HWaddr 52:54:00:FD:28:8D
- inet addr:192.168.122.1 Bcast:192.168.122.255 Mask:255.255.255.0
- UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
- RX packets:718 errors:0 dropped:0 overruns:0 frame:0
- TX packets:1125 errors:0 dropped:0 overruns:0 carrier:0
- collisions:0 txqueuelen:0
- RX bytes:111376 (108.7 KiB) TX bytes:104168 (101.7 KiB)
复制代码
- //此为在实体机的终端中用ssh远程登录的方式对虚拟机做ifconfig操作
- # ifconfig
- eth0 Link encap:Ethernet HWaddr 52:54:00:20:F4:C2
- inet addr:192.168.122.174 Bcast:192.168.122.255 Mask:255.255.255.0
- inet6 addr: fe80::5054:ff:fe20:f4c2/64 Scope:Link
- UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
- RX packets:6655 errors:0 dropped:0 overruns:0 frame:0
- TX packets:6447 errors:0 dropped:0 overruns:0 carrier:0
- collisions:0 txqueuelen:1000
- RX bytes:521855 (509.6 KiB) TX bytes:1727798 (1.6 MiB)
- 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:22 errors:0 dropped:0 overruns:0 frame:0
- TX packets:22 errors:0 dropped:0 overruns:0 carrier:0
- collisions:0 txqueuelen:0
- RX bytes:11950 (11.6 KiB) TX bytes:11950 (11.6 KiB)
复制代码 现在的问题是我可以在实体机中用ssh登录的方式操作虚拟机,但是不能访问虚拟机下的http网站
虚拟机也可以用ssh登录的方式操作虚拟机,还可以访问实体机的ftp,可是偏偏不能访问实体机下的http网站
而且虚拟机访问实体机的ftp时可以采用各种方法,包扩和虚拟机在同一网段的ip,还有我的实体机对外的ip,以及我的实体机上绑定的域名,可是就是不能连接http
以下是些截屏,仅供参考,如果不全,请联系我,谢谢大家
虚拟机用192.168.122.1(我的虚拟网卡的ip)不能访问我的实体机上的http网页
虚拟机用192.168.122.1(我的实际网卡的ip)不能访问我的实体机上的http网页
虚拟机用mylover.imzone.in(我的网卡绑定的域名)不能访问我的实体机上的http网页
虚拟机用mylover.imzone.in(我的网卡绑定的域名)毫无压力的访问我的实体机上的ftp,此ftp用vsftpd服务
我的虚拟机的一些状态- # traceroute -n -f 8 -q 1 mylover.imzone.in
- traceroute to mylover.imzone.in (10.2.25.107), 30 hops max, 60 byte packets
- 8 10.2.25.107 0.473 ms !X
复制代码- # traceroute -n mylover.imzone.in
- traceroute to mylover.imzone.in (10.2.25.107), 30 hops max, 60 byte packets
- 1 10.2.25.107 0.219 ms !X 0.158 ms !X 0.121 ms !X
复制代码- #dig mylover.imzone.in
- ; <<>> DiG 9.7.3-P3-RedHat-9.7.3-8.P3.el6 <<>> mylover.imzone.in
- ;; global options: +cmd
- ;; Got answer:
- ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 8174
- ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
- ;; QUESTION SECTION:
- ;mylover.imzone.in. IN A
- ;; ANSWER SECTION:
- mylover.imzone.in. 3153 IN A 10.2.25.107
- ;; Query time: 0 msec
- ;; SERVER: 192.168.122.1#53(192.168.122.1)
- ;; WHEN: Sun May 27 04:54:11 2012
- ;; MSG SIZE rcvd: 51
复制代码
我的虚拟机的一些状态- #tcpdump -nn host 10.2.25.107 and tcp port 21
- tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
- listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes
- 05:00:24.596608 IP 192.168.122.174.39882 > 10.2.25.107.21: Flags [P.], seq 4272738:4272744, ack 102910156, win 229, options [nop,nop,TS val 1619776 ecr 8072027], length 6
- 05:00:24.597182 IP 10.2.25.107.21 > 192.168.122.174.39882: Flags [P.], seq 1:50, ack 6, win 114, options [nop,nop,TS val 8081255 ecr 1619776], length 49
- 05:00:24.604582 IP 192.168.122.174.39882 > 10.2.25.107.21: Flags [P.], seq 6:12, ack 50, win 229, options [nop,nop,TS val 1619784 ecr 8081255], length 6
- 05:00:24.605038 IP 10.2.25.107.21 > 192.168.122.174.39882: Flags [P.], seq 50:89, ack 12, win 114, options [nop,nop,TS val 8081263 ecr 1619784], length 39
- 05:00:24.618454 IP 10.2.25.107.21 > 192.168.122.174.39882: Flags [P.], seq 89:113, ack 12, win 114, options [nop,nop,TS val 8081276 ecr 1619784], length 24
- 05:00:24.618513 IP 192.168.122.174.39882 > 10.2.25.107.21: Flags [.], ack 113, win 229, options [nop,nop,TS val 1619798 ecr 8081263], length 0
- ^C
- 6 packets captured
- 6 packets received by filter
- 0 packets dropped by kernel
复制代码- # tcpdump -nn host 10.2.25.107 and tcp port 80
- tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
- listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes
- ^C
- 0 packets captured
- 0 packets received by filter
- 0 packets dropped by kernel
复制代码- # route -n
- Kernel IP routing table
- Destination Gateway Genmask Flags Metric Ref Use Iface
- 192.168.122.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
- 169.254.0.0 0.0.0.0 255.255.0.0 U 1002 0 0 eth0
- 0.0.0.0 192.168.122.1 0.0.0.0 UG 0 0 0 eth0
复制代码 以上截屏和代码均来自实体机下ssh登录到虚拟机下的操作获得
谢谢大家帮忙 |
|