View Full Version : [ubuntu] Trouble with Masquerading

July 9th, 2009, 07:15 PM
I'm trying to masquerade an Internet connection using one of my laptops (one running intrepid and the other jaunty) to a dell desktop with jaunty freshly installed. I followed the guide at https://help.ubuntu.com/community/Internet/ConnectionSharing and executed the commands successfully. Here's the laptop's setup:

eth0 Link encap:Ethernet HWaddr 00:1b:24:57:51:87
inet6 addr: fe80::21b:24ff:fe57:5187/64 Scope:Link
RX packets:108 errors:0 dropped:0 overruns:0 frame:0
TX packets:191 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:17912 (17.9 KB) TX bytes:43204 (43.2 KB)
Interrupt:20 Base address:0x4000

eth1 Link encap:Ethernet HWaddr 00:14:a5:df:29:58
inet addr: Bcast: Mask:
inet6 addr: fe80::214:a5ff:fedf:2958/64 Scope:Link
RX packets:19455 errors:0 dropped:0 overruns:0 frame:17770
TX packets:14911 errors:13 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:26658594 (26.6 MB) TX bytes:1535389 (1.5 MB)
Where eth0 is the connection that goes to the dell computer with a cross over cable, and eth1 is my wireless connection that supplies internet. So I went to work following the guide:

sudo su -
ifconfig eth0
iptables -A FORWARD -i eth1 -o eth0 -s -m stsate --state NEW -j ACCEPT
iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A POSTROUTING -t nat -j MASQUERADE
echo "1" > /proc/sys/net/ipv4/ip_forward
I also edited the /etc/sysctl.conf to read:

# /etc/sysctl.conf - Configuration file for setting system variables
# See /etc/sysctl.d/ for additional system variables.
# See sysctl.conf (5) for information.


I configured the dell machine's networking:

sudo /etc/int.d/networking stop
sudo ifconfig eth0
sudo route add default gw
sudo cp /etc/resolv.conf /etc/resolve.conf.bak
sudo gedit /etc/dhcp3/dhclient.conf and changed the prepend domain-name-servers line to read one of my ISP's DNS servers and as a backup.
then ran
sudo /etc/init.d/networking restart
PING ( 56(84) bytes of data.
FROM icmp_seq=1 Destination host unreachable

So I decided to try an use firestarter. I ran the "Restore" script to reset IP tables, and fired up firestarter. I connected the computers, and Enabled internet connection sharing with DHCP. Still no go. The client computer I configured to connect with network manager as DHCP but it never was able to connect. eth0 on the server got

Please help!

July 9th, 2009, 08:14 PM
try doing the ICS without DHCP and insert ip manually in clients.. use firestarter..

July 9th, 2009, 08:31 PM
I think I've isolated the problem to the connection. I connected the crossover cable to the Jaunty laptop and the Intrepid laptop with network manager set to DHCP on both ends. The Intrepid laptop gets IP, Brodcast, Subnet Mask, and the DNS matches the one for wlan0. On the Jaunty laptop, it's all the same, except it gets IP

but when I ping any of the machines from each other I get:
PING ( 56(84) bytes of data.
--- ping statistics ---
11 packets transmitted, 0 received, 100% packet loss, time 10056ms

When I try to do the same with the desktop, the laptop says eth0 is connected with the address of, but the desktop just keeps requesting an address until it times out. [note that I configured it how the guide said to, I'll try clearing it later].

What is the proper configuration for network manager?

July 10th, 2009, 11:43 AM
do try with static ip.. and do you have firestarter or gufw or anything installed?? post output of sudo iptables -L