0

I'm using a Debian based Linux system, basically there are these interfaces:

wlan0 "wifi connected - 192.168.0.0/24"
interface2 "not physical interface - 192.168.20.0/24"
eth0 "ethernet cable unplugged- suppose to be connected to windows 7"

What I want is share connection from my Linux to windows 7 through ethernet cable. What i did was using network manager and configure eth0 as "shared to other computer" and it worked!

When I connect linux to windows computer using the cable, my windows 7 pc automatically connect to wlan0 interface and got that interface public ip! What I want is do the same but using only the interface2 interface!

So that my windows pc can browse that specific network using interface2 and shared connection!

Is there a way to do it?

1

You've got 2 options basically.

Either using bridging the connection which will make the windows machine 'appear' to be on exactly the same network as the linux machine, it'd get a DHCP address the same way the linux machine got one, etc.

Or IP Forwarding which means the packets coming in over the eth0 are then forwarded onto the wifi network, and the windows machine will 'appear' to be the linux machine, to anything else on the network.

Each link contains a guide to setting up the appropriate method, and they are both too long to really contain in a answer post. Once you've decided on which method you want to use, it should be a lot easier to find a guide to setting it up exactly as you want it.

0

Found the solution! To let my windows 7 join the network on interface2 just did:

sudo brctl addbr br0
sudo brctl addif br0 eth0 interface2
sudo ifconfig br0 up
sudo ifconfig eth0 up
sudo ifconfig interface2 up

they all where without ip, br0 had automatic dhcp option.

Windows 7 also automatic dhcp.

Then just connect linux to windows with ethernet cable and done! My windows 7 machine joined the network on interface2 and had its own internal ip 192.168.20.2 and was able to browse web and have my public ip from that network!

  • What is the interface2 ? A wifi or ethernet interface? i am a bit confused – GAD3R Oct 5 '17 at 17:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.