-----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 - -- -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) iD8DBQE91WbU0iMVcrivHFQRAtiTAJ9ZkhUrNqz8FVQSBePLGdvl48w2YwCfeuh6 xTlPZ/J4uQVQ2m9gzStSCp0= =/XMl -----END PGP SIGNATURE----- -- redhat-list mailing list unsubscribe mailto:redhat-list-request@;redhat.com?subject=unsubscribe https://listman.redhat.com/mailman/listinfo/redhat-list