Computing.Net > Forums > Linux > ip masquerading: win98 via linux router

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

ip masquerading: win98 via linux router

Reply to Message Icon

Name: Bob Flagg
Date: July 6, 2002 at 17:32:46 Pacific
Comment:

I've set up a linux (redhat 7.3) router for my home network and things work fine for my linux client machines but not for my win98 client. My router's external connection is via cable modem, I'm running a dhcp server on the router and the win98 client does get an ip. Also internal MASQ client to internal MASQ server connectivity works but internal MASQ client to external MASQ server connectivity fails. I'm using iptables via the following shell script:
#!/bin/sh
PATH=/sbin
export PATH
IPT=/sbin/iptables

# define interfaces
# internal interface
IINT=eth1
# external interface (can be ppp+, eth#, ippp+, etc.)
IEXT=eth0
# internal network
INTNET=192.168.1.0/24

# first, turn off forwarding
echo 0 > /proc/sys/net/ipv4/ip_forward

modprobe ip_tables
modprobe ip_nat_ftp
modprobe ip_conntrack_ftp

# flush all chains and delete user chains
for i in filter nat mangle
do
$IPT -t $i -F
$IPT -t $i -X
done

# if your ISP blocks "fragmentation needed" ICMP packets, i.e.,:
# web browsers connect, then hand with no data received
# small e-mail works OK, but large e-mails hang
# ssh works OK, but scp hangs after initial handshake
# uncomment the following:
#$IPT -t filter -A FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu

# create new user chain
$IPT -t filter -N tcprules

$IPT -A tcprules -i $IEXT -m state --state ESTABLISHED,RELATED -j ACCEPT
$IPT -A tcprules -i ! $IEXT -m state --state NEW -j ACCEPT
$IPT -A tcprules -i $IEXT -m state --state NEW,INVALID -j LOG --log-prefix "IPT DROP "
$IPT -A tcprules -i $IEXT -m state --state NEW,INVALID -j DROP

$IPT -A INPUT -j tcprules
$IPT -A FORWARD -j tcprules

# now for masquerading
$IPT -t nat -A POSTROUTING -o $IEXT -s $INTNET -j MASQUERADE
#iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

# a few mangle rules you might or might not want to try out
# note that ssh does its own TOS, so is not required below
$IPT -t mangle -A PREROUTING -m multiport -p tcp --dport 80,21,22 -j TOS --set-tos 16
$IPT -t mangle -A PREROUTING -m multiport -p tcp --sport 80,21,22 -j TOS --set-tos 16
$IPT -t mangle -A PREROUTING -p tcp --dport ftp-data -j TOS --set-tos 8
$IPT -t mangle -A PREROUTING -p tcp --sport ftp-data -j TOS --set-tos 8
$IPT -t mangle -A PREROUTING -p tcp --dport 25 -j TOS --set-tos 4
$IPT -t mangle -A PREROUTING -p tcp --dport 110 -j TOS --set-tos 2

# if you have a line in your /etc/sysctl.conf like this:
# net.ipv4.ip_forward = 1
# uncomment the following and comment out the echo line below it
#/sbin/sysctl -p > /dev/null
echo 1 > /proc/sys/net/ipv4/ip_forward




Sponsored Link
Ads by Google

Response Number 1
Name: voigt
Date: July 8, 2002 at 07:22:27 Pacific
Reply:

I've not tries iptables, only ipchains.... but what is in your hosts.allow file ???

and is your win98 box getting the correct gateway setting...

FWIW
~voigt


0

Response Number 2
Name: Tharrrk
Date: August 31, 2002 at 02:44:08 Pacific
Reply:

Try this...

add route 255.255.255.255 dev eth1


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Linux Forum Home


Sponsored links

Ads by Google


Results for: ip masquerading: win98 via linux router

Help in setting RH Linux Router/Firewall www.computing.net/answers/linux/help-in-setting-rh-linux-routerfirewall/10098.html

internet access with win98 via linux www.computing.net/answers/linux/internet-access-with-win98-via-linux/8053.html

Ip MAsquerade - nat help www.computing.net/answers/linux/ip-masquerade-nat-help/8027.html