Gentoo Archives: gentoo-user

From: Kostyantyn <fastinetserver@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] ping / connect to another subnet
Date: Tue, 30 Mar 2010 21:11:47
Message-Id: 1269981789.3648.32.camel@monapc
In Reply to: Re: [gentoo-user] ping / connect to another subnet by Joseph
1 On Tue, 2010-03-30 at 13:08 -0600, Joseph wrote:
2 > On 03/30/10 14:55, stosss wrote:
3 > >On Tue, Mar 30, 2010 at 2:08 PM, Joseph <syscon780@×××××.com> wrote:
4 > >> I'm running Windows XP on VirtualBox, it has a network "NAT" so the IP
5 > >> address it gets:
6 > >> IP: 10.0.2.15
7 > >> Gateway: 10.0.2.2
8 > >> DNS: 10.10.0.1 ?(Linux router)
9 > >>
10 > >> I've tried to access the Windows IP by creating another subnet:
11 > >> ifconfig eth0:1 10.0.2.0 up
12 > >>
13 > >> but it doesn't work, I can not ping the Windows IP: ?10.0.2.15
14 > >> (Windows firewall is OFF)
15 > >>
16 > >> Any suggestions?
17 > >
18 > >You could try using Bridged instead of NAT. Bridged would let you set
19 > >up the NIC on the VM to the same IP address range as the host using
20 > >the same NIC as the host.
21 > >
22 > >If your host IP is 192.168.1.10 on eth0
23 > >You could set Bridged > eth0 on the VM settings panel and then set
24 > >your net config inside the VMs OS to 192.168.1.X on eth0
25 >
26 > Yes, I'm aware of it.
27 > I've setup iptables + squid so I can filter here they an connect to.
28 > If I setup as Bridge, Windows gets the IP from the Router (dhcpd) and will by-pass my filter :-/
29 > My router does not filter outgoing traffic only incoming.
30 >
31 > I setup on VirtualBox one interface as NAT and one as Bridge and Windows browser selected the one without filer Bridge, so it is bypassing my filter.
32 >
33 Check the User Manual for Virtual Box:
34 http://download.virtualbox.org/virtualbox/3.1.6/UserManual.pdf
35 Take a look at section 6.3:"VirtualBox.
36 A virtual machine with NAT enabled acts much like a real computer that
37 connects
38 to the Internet through a router. The “router”, in this case, is the
39 VirtualBox network-
40 ing engine, which maps traffic from and to the virtual machine
41 transparently. The
42 disadvantage of NAT mode is that, much like a private network behind a
43 router, the
44 virtual machine is invisible and unreachable from the outside internet;
45 you cannot run
46 a server this way unless you set up port forwarding (described below)."
47
48 I would suggest to manually set up your ip address and (or tune dhcp
49 server for VirtualHost).
50
51 Then should be easy to adjust your settings for iptables+squid.
52
53 If i get you right on you hosting OS you have iptables+squid ?!
54
55 Then probably you should do the following:
56
57 1) Use bridged connection for you VM (WindowsXP).
58 2) In Windows XP:
59 2.1 Set up ip address manually at the same network as your host
60 machine.
61 2.2 Make settings for your browser to use proxy server (ip and port of
62 your linuxbox(hosting machine) with squid).
63 2.3 If you have forwarding and dns you can also set them at the network
64 setting window.
65 3) In your LinuxBox (host machine):
66 2.1. Use iptables to allow traffic between squid and you winXP.
67 2.2. Setup squid to allow access from winXP.
68
69 In most cases it should be easy.