ALT Linux users (in English only)
 help / color / mirror / Atom feed
* [Comm-en] sharing Internet access
@ 2003-03-31 16:29 D&J Bouley
  2003-03-31 17:15 ` Michael Shigorin
  0 siblings, 1 reply; 2+ messages in thread
From: D&J Bouley @ 2003-03-31 16:29 UTC (permalink / raw)
  To: community-en

In reference to the instructions I received concerning the setup of network 
sharing, can anyone tell me...

I named our local network "VirtualSkyNet" and my gateway address to 
192.168.0.1 during the set-up.  Do I replace the $LOCALNET=192.168.9.0/24 
variable with $VirtualSkyNet=192.168.0.1/24 in the script below?

I assume I only have to run this script once to get Internet sharing 
functional.

David.

D&J Bouley wrote:
> 
> Greetings,
> 
> First, let me say how pleased I am with the new release of Junior 2.2.  I
> installed it on my PC over the weekend and have been enjoying it ever since.
> 
> I do have a problem I cannot seem to overcome, regarding sharing my Internet
> connection over my home network.  I get an error from the ALT Linux Control
> Center application that I do not know how to overcome.  I was able to do 
this
> easily using my old Mandrake 8.2 OS (which I replaced with Junior 2.2).
> 


You can use this small ease script for sharing Internet to
localnetwork:

###################
#!/bin/sh
modprobe ipchains
IPCHAINS=/sbin/ipchains

Any="0.0.0.0/0"
localhost_localdomain="127.0.0.1/32"
$LOCALNET="192.168.9.0/24"

$IPCHAINS -P input ACCEPT
$IPCHAINS -P forward ACCEPT
$IPCHAINS -P output ACCEPT

$IPCHAINS -F
$IPCHAINS -X

# input rules

# forward rules
$IPCHAINS -A forward -s $LOCALNET -d $Any -j MASQ
# output rules
###################

$LOCALNET - is your local network, change this if need.

Before set FORWARD_IPV4=true in file /etc/sysconfig/network and
say:
service network restart
-- 

============================================
(o_
//\
\/_/  E-mail powered by Linux
============================================
======



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Comm-en] sharing Internet access
  2003-03-31 16:29 [Comm-en] sharing Internet access D&J Bouley
@ 2003-03-31 17:15 ` Michael Shigorin
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Shigorin @ 2003-03-31 17:15 UTC (permalink / raw)
  To: community-en; +Cc: community

On Mon, Mar 31, 2003 at 10:29:03AM -0600, D&J Bouley wrote:
> I named our local network "VirtualSkyNet" and my gateway
> address to 192.168.0.1 during the set-up.

Good. :)

> Do I replace the $LOCALNET=192.168.9.0/24 variable with
> $VirtualSkyNet=192.168.0.1/24 in the script below?

No, it's just the _variable_ name.

> I assume I only have to run this script once to get Internet
> sharing functional.

Well this could be simpler:

--- /etc/sysconfig/iptables ---
*filter
-A INPUT -j tcprules
-A FORWARD -j tcprules
-A tcprules -i ppp0 -m state --state RELATED,ESTABLISHED -j ACCEPT
-A tcprules -i ! ppp0 -m state --state NEW -j ACCEPT
-A tcprules -i ppp0 -m state --state INVALID,NEW -j DROP
-A tcprules -i ppp0 -j REJECT --reject-with icmp-host-unreachable
COMMIT
*nat
-A POSTROUTING -s 192.168.0.0/24 -o ppp0 -j MASQUERADE
COMMIT
--- end of /etc/sysconfig/iptables ---

(btw, 192.168.0.0/24 and 192.168.0.1/24 are just the same as the
last byte would be outside the _network_ address being the _host_
part)

Then make sure /etc/sysctl.conf has the line as here:

---
net.ipv4.ip_forward = 1
---

(my favorite oops-forgot-it is not to enable forwarding %)

To enable it all now, do

rmmod ipchains
echo "1" > /proc/sys/net/ipv4/ip_forward
service iptables restart

which will result in stateful firewall with NAT up and running.
Well, hopefully -- I didn't actually test this :-)

PS: if the internet interface is not ppp0 and say eth1 -- make
appropriate changes.

PPS: 2ALT: hey if we've broken drakgw we'd really better
introduce something yet better ;-)

-- 
 ---- WBR, Michael Shigorin <mike@altlinux.ru>
  ------ Linux.Kiev http://www.linux.kiev.ua/


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-03-31 17:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-31 16:29 [Comm-en] sharing Internet access D&J Bouley
2003-03-31 17:15 ` Michael Shigorin

ALT Linux users (in English only)

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/community-en/0 community-en/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 community-en community-en/ http://lore.altlinux.org/community-en \
		community-en@lists.altlinux.org community-en@lists.altlinux.ru community-en@lists.altlinux.com
	public-inbox-index community-en

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.community-en


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git