Forum Home
Press F1
 
Thread ID: 58081 2005-05-21 04:14:00 [Linux] Networking for no0bs Myth (110) Press F1
Post ID Timestamp Content User
357171 2005-05-27 21:57:00 Try something like:
/sbin/iptables -A POSTROUTING -t nat -s 192.168.0.0/24 -o eth0 -j MASQUERADE

Either that, or have a look here:
www.linux.net.nz
Chilling_Silence (9)
357172 2005-05-28 00:22:00 OK, found a site last night after I posted here (before I read Chills post) which was supposed to help with setting up ICS (based around iptables). Unfortunately I lost the ability for the Win Laptop to see my server.
However this morn I decided to check some things, found dhcp server (also gateway to net) wasn't working, so found howto and now have the dhcp server working successfully.
Copy and pasted Chills line into terminal as root and managed to see Linux box (dhcp server, gateway) again from lappie. Still no Internet sharing though.
Any ideas, without iptables killing my network again.

BTW, this is a mission lol, but damn at the networking s**t I'm learning :D
Myth (110)
357173 2005-05-28 23:32:00 Umm, Houston... we have a problem

I am finding that if I try and use iptables/masquerading that StatServer (the linux gateway, dhcp server) disappears from the network. Its still accessible via ping, and it can ping the windows box, but it doesn't show in the Network Places in Win XP. The Windows XP machine still shows in the Computer under Networks icon in FC3.
Whats causing this?

Incidentally, I installed Firestarter, even before I had rebooted to install properly, the entire network disappeared, so I uninstalled it. I did however try to configure it in the hope the network would come back. The StatServer couldn't even be pinged.

Also, I found this script online which I think will suit my iptables needs (If I ever get my server to show up again); seems ok to me (with my limited thus far knowledge of IPtables)... what do you think (@anyone)

#!/bin/bash
IPTABLES='/sbin/iptables'
# Set interface values
EXTIF='ppp0'
INTIF1='eth1'
# enable ip forwarding in the kernel
/bin/echo 1 > /proc/sys/net/ipv4/ip_forward
# flush rules and delete chains
$IPTABLES -F
$IPTABLES -X
# enable masquerading to allow LAN internet access
$IPTABLES -t nat -A POSTROUTING -o $EXTIF -j MASQUERADE
# forward LAN traffic from $INTIF1 to Internet interface $EXTIF
$IPTABLES -A FORWARD -i $INTIF1 -o $EXTIF -m state --state NEW,ESTABLISHED -j ACCEPT
#echo -e " - Allowing access to the SSH server"
$IPTABLES -A INPUT --protocol tcp --dport 22 -j ACCEPT
#echo -e " - Allowing access to the HTTP server"
$IPTABLES -A INPUT --protocol tcp --dport 80 -j ACCEPT
# block out all other Internet access on $EXTIF
$IPTABLES -A INPUT -i $EXTIF -m state --state NEW,INVALID -j DROP
$IPTABLES -A FORWARD -i $EXTIF -m state --state NEW,INVALID -j DROP

As a sidenote to the above script... ppp0 is configured so that the ISP provides the DNS and DHCP info for that interface (usual for dialup)

Will I need to disable SELinux if I use IPtables?

As a further edit, under SELinux rules, eth0 and ppp0 (when activated) are trusted interfaces
Myth (110)
357174 2005-05-28 23:54:00 Umm, Houston... we have a problem

I am finding that if I try and use iptables/masquerading that StatServer (the linux gateway, dhcp server) disappears from the network. Its still accessible via ping, and it can ping the windows box, but it doesn't show in the Network Places in Win XP. The Windows XP machine still shows in the Computer under Networks icon in FC3.
Whats causing this?
Nevermind, just happened to look in Services and discovered smb wasn't running (although the 2 daemons were). Put the dot in the box and hullo, the Server showed up :D
Myth (110)
1 2