Discussion Locked

linux

0 helpful
9 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
how we can share internet source in linux system to other winows clients?

9 replies

by cpfeiffe

I'm not sure I know exactly what you are trying to do, but it sounds like you want to share files/folders in Linux to Windows machines. If that is the case then you need to configure samba server on your linux box. If you did a default install samba should already be there, if not you can get it from your install CDs. www.samba.org has good documentation on configurations. Good luck.

by penguin netwerx

If you're asking how to share an Internet connection through your Linux machine to other Windows users on your network, you can use IPTables. Create a new file called rc.firewall in /etc/rc.d/ (or wherever you place your startup scripts) and add the following to it:

#!/bin/sh
# This sets the second NIC to the IP we want to use for the routing:
ifconfig eth1 192.168.0.1
# This line brings eth1 online:
ifconfig eth1 up

echo "1" > /proc/sys/net/ipv4/ip_forward

# Here we go:
echo "Starting IP Masquerading..."
iptables -A FORWARD -i eth0 -o eth1 -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A FORWARD -i eth1 -o eth0 -j ACCEPT
iptables -A FORWARD -j LOG

echo "Enabling SNAT..."
iptables -t nat -A PREROUTING -p tcp --dport 3389 -i eth0 -j DNAT --to 192.168.0.2:3389
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

echo "Firewall Configured Successfully..."

# Don't forget to chmod +x rc.firewall before running it.
# And add the next line to /etc/rc.d/rc.local (or whatever startup directory/script you use):
# /etc/rc.d/rc.firewall

This is a basic firewall ruleset for IPTables. Read the manpage for iptables or do "iptables -h" for more information.

by penguin netwerx

If you're asking how to share an Internet connection through your Linux machine to other Windows users on your network, you can use IPTables. Create a new file called rc.firewall in /etc/rc.d/ (or wherever you place your startup scripts) and add the following to it:

#!/bin/sh
# This sets the second NIC to the IP we want to use for the routing:
ifconfig eth1 192.168.0.1
# This line brings eth1 online:
ifconfig eth1 up

echo "1" > /proc/sys/net/ipv4/ip_forward

# Here we go:
echo "Starting IP Masquerading..."
iptables -A FORWARD -i eth0 -o eth1 -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A FORWARD -i eth1 -o eth0 -j ACCEPT
iptables -A FORWARD -j LOG

echo "Enabling SNAT..."
iptables -t nat -A PREROUTING -p tcp --dport 3389 -i eth0 -j DNAT --to 192.168.0.2:3389
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

echo "Firewall Configured Successfully..."

# Don't forget to chmod +x rc.firewall before running it.
# And add the next line to /etc/rc.d/rc.local (or whatever startup directory/script you use):
# /etc/rc.d/rc.firewall

This is a basic firewall ruleset for IPTables. Read the manpage for iptables or do "iptables -h" for more information.

by penguin netwerx

If you're asking how to share an Internet connection through your Linux machine to other Windows users on your network, you can use IPTables. Create a new file called rc.firewall in /etc/rc.d/ (or wherever you place your startup scripts) and add the following to it:

#!/bin/sh
# This sets the second NIC to the IP we want to use for the routing:
ifconfig eth1 192.168.0.1
# This line brings eth1 online:
ifconfig eth1 up

echo "1" > /proc/sys/net/ipv4/ip_forward

# Here we go:
echo "Starting IP Masquerading..."
iptables -A FORWARD -i eth0 -o eth1 -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A FORWARD -i eth1 -o eth0 -j ACCEPT
iptables -A FORWARD -j LOG

echo "Enabling SNAT..."
iptables -t nat -A PREROUTING -p tcp --dport 3389 -i eth0 -j DNAT --to 192.168.0.2:3389
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

echo "Firewall Configured Successfully..."

# Don't forget to chmod +x rc.firewall before running it.
# And add the next line to /etc/rc.d/rc.local (or whatever startup directory/script you use):
# /etc/rc.d/rc.firewall

This is a basic firewall ruleset for IPTables. Read the manpage for iptables or do "iptables -h" for more information.

by penguin netwerx

If you're asking how to share an Internet connection through your Linux machine to other Windows users on your network, you can use IPTables. Create a new file called rc.firewall in /etc/rc.d/ (or wherever you place your startup scripts) and add the following to it:

#!/bin/sh
# This sets the second NIC to the IP we want to use for the routing:
ifconfig eth1 192.168.0.1
# This line brings eth1 online:
ifconfig eth1 up

echo "1" > /proc/sys/net/ipv4/ip_forward

# Here we go:
echo "Starting IP Masquerading..."
iptables -A FORWARD -i eth0 -o eth1 -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A FORWARD -i eth1 -o eth0 -j ACCEPT
iptables -A FORWARD -j LOG

echo "Enabling SNAT..."
iptables -t nat -A PREROUTING -p tcp --dport 3389 -i eth0 -j DNAT --to 192.168.0.2:3389
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

echo "Firewall Configured Successfully..."

# Don't forget to chmod +x rc.firewall before running it.
# And add the next line to /etc/rc.d/rc.local (or whatever startup directory/script you use):
# /etc/rc.d/rc.firewall

This is a basic firewall ruleset for IPTables. Read the manpage for iptables or do "iptables -h" for more information.

by penguin netwerx

If you're asking how to share an Internet connection through your Linux machine to other Windows users on your network, you can use IPTables. Create a new file called rc.firewall in /etc/rc.d/ (or wherever you place your startup scripts) and add the following to it:

#!/bin/sh
# This sets the second NIC to the IP we want to use for the routing:
ifconfig eth1 192.168.0.1
# This line brings eth1 online:
ifconfig eth1 up

echo "1" > /proc/sys/net/ipv4/ip_forward

# Here we go:
echo "Starting IP Masquerading..."
iptables -A FORWARD -i eth0 -o eth1 -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A FORWARD -i eth1 -o eth0 -j ACCEPT
iptables -A FORWARD -j LOG

echo "Enabling SNAT..."
iptables -t nat -A PREROUTING -p tcp --dport 3389 -i eth0 -j DNAT --to 192.168.0.2:3389
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

echo "Firewall Configured Successfully..."

# Don't forget to chmod +x rc.firewall before running it.
# And add the next line to /etc/rc.d/rc.local (or whatever startup directory/script you use):
# /etc/rc.d/rc.firewall

This is a basic firewall ruleset for IPTables. Read the manpage for iptables or do "iptables -h" for more information.

by penguin netwerx

If you're asking how to share an Internet connection through your Linux machine to other Windows users on your network, you can use IPTables. Create a new file called rc.firewall in /etc/rc.d/ (or wherever you place your startup scripts) and add the following to it:

#!/bin/sh
# This sets the second NIC to the IP we want to use for the routing:
ifconfig eth1 192.168.0.1
# This line brings eth1 online:
ifconfig eth1 up

echo "1" > /proc/sys/net/ipv4/ip_forward

# Here we go:
echo "Starting IP Masquerading..."
iptables -A FORWARD -i eth0 -o eth1 -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A FORWARD -i eth1 -o eth0 -j ACCEPT
iptables -A FORWARD -j LOG

echo "Enabling SNAT..."
iptables -t nat -A PREROUTING -p tcp --dport 3389 -i eth0 -j DNAT --to 192.168.0.2:3389
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

echo "Firewall Configured Successfully..."

# Don't forget to chmod +x rc.firewall before running it.
# And add the next line to /etc/rc.d/rc.local (or whatever startup directory/script you use):
# /etc/rc.d/rc.firewall

This is a basic firewall ruleset for IPTables. Read the manpage for iptables or do "iptables -h" for more information.

by penguin netwerx

If you're asking how to share an Internet connection through your Linux machine to other Windows users on your network, you can use IPTables. Create a new file called rc.firewall in /etc/rc.d/ (or wherever you place your startup scripts) and add the following to it:

#!/bin/sh
# This sets the second NIC to the IP we want to use for the routing:
ifconfig eth1 192.168.0.1
# This line brings eth1 online:
ifconfig eth1 up

echo "1" > /proc/sys/net/ipv4/ip_forward

# Here we go:
echo "Starting IP Masquerading..."
iptables -A FORWARD -i eth0 -o eth1 -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A FORWARD -i eth1 -o eth0 -j ACCEPT
iptables -A FORWARD -j LOG

echo "Enabling SNAT..."
iptables -t nat -A PREROUTING -p tcp --dport 3389 -i eth0 -j DNAT --to 192.168.0.2:3389
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

echo "Firewall Configured Successfully..."

# Don't forget to chmod +x rc.firewall before running it.
# And add the next line to /etc/rc.d/rc.local (or whatever startup directory/script you use):
# /etc/rc.d/rc.firewall

This is a basic firewall ruleset for IPTables. Read the manpage for iptables or do "iptables -h" for more information.

by penguin netwerx

I have NO IDEA why that answer is listed 8 times.

(NOTE: SNAT is an example on how to do port forwarding. The example above uses the port for MS Terminal Server access.)

This discussion is closed to new replies.