Michael Schwendt wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On Sat, 16 Nov 2002 02:34:34 +0800, [EMAIL PROTECTED] wrote:
>
> > I have just setup NAT and DHCP , but can't connect to the internet
> > with client :
> >
> > Get IP from dhcp server :
> >
> > C:\>ipconfig
> >
> > Windows 2000 IP Configuration
> >
> > Ethernet adapter :
> >
> >         Connection-specific DNS Suffix  . :
> >         IP Address. . . . . . . . . . . . : 172.2.0.1
> >         Subnet Mask . . . . . . . . . . . : 255.255.255.0
> >         Default Gateway . . . . . . . . . : 172.2.0.254
> >
> > C:\>
> >
> > My config file :
> >
> > /etc/sysconfig/network-scripts/ifcfg-eth1 :
> > DEVICE=eth1
> > ONBOOT=yes
> > IPADDR=172.2.0.254
> > NETMASK=255.255.255.0
> >
> > /etc/rc.d/rc.local :
> > echo '1' > /proc/sys/net/ipv4/ip_forward
> > modprobe ip_nat_ftp
> > modprobe ip_conntrack
> > modprobe ip_conntrack_ftp
> > modprobe ip_conntrack_irc
> > iptables -t nat -A POSTROUTING -o eth1 -s 172.2.0.0/24 -j MASQUERADE
> >
> > /etc/dhcpd.conf :
> > subnet 172.2.0.0 netmask 255.255.255.0 {
> >         range 172.2.0.1 172.2.0.253;
> >         default-lease-time 604800;
> >         max-lease-time 604800;
> >         option broadcast-address 172.2.0.255;
> >         option routers 172.2.0.254;
> >         option domain-name-servers 192.168.200.1;
> > }
> >
> > Edit /etc/rc.d/init.d/dhcpd :
> > ....
> > start() {
> >         # Start daemons.
> >         echo -n $"Starting $prog: "
> >         daemon /usr/sbin/dhcpd eth1 ${DHCPDARGS}
> >         RETVAL=$?
> >         echo
> >         [ $RETVAL -eq 0 ] && touch /var/lock/subsys/dhcpd
> >         return $RETVAL
> > }
> > ...
> >
> > touch /var/lib/dhcp/dhcpd.leases
> >
> > /etc/rc.d/init.d/dhcpd start
> >
> > PS : the system is Redhat 7.2, port eth0 is connected to the lease
> > line...
>
> If eth0 is your outgoing connection, the masquerading rule above
> should also specify eth0, not eth1:
>
>   iptables -t nat -A POSTROUTING -o eth0 -s 172.2.0.0/24 -j MASQUERADE

I don't understand must I specify eth0 and eth1 ?
or edit the line as :
iptables -t nat -A POSTROUTING -s 172.2.0.0/24 -j MASQUERADE

eth0 : connected to the Internet with lease line ( IP address from ISP )
eth1 : connected with HUB and other client ( NAT + DHCP ), but the IP is
private...

So, if specify eth0, then what will happen ?

Thank for your help !

Edward.




-- 
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to