LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 04-29-2010, 05:53 AM   #1
zivs
Member
 
Registered: Jan 2005
Location: Ogre, Latvia
Distribution: Ubuntu 9.10
Posts: 72

Rep: Reputation: 15
Connecting to internet with Lubuntu through Ubuntu machine


Hey,

Most probably this is already discussed several times, but I wasn't able to find any user friendly manuals on how to create some sort of network, which would mean that one computer (Lubuntu in this case) is connecting to internet through second PC (Ubuntu), which is directly connected to cable, so maybe you could help me out with some manuals and tips.

The computer which is connected to internet have two LAN cards (Realtek 8139 and integrated nVidia MCP65), Realtek card is connected to the internet provider cable (internet is tied to my computer's MAC address and uses static IP).

Second computer have also a Realtek card and it's connected to first computers integrated card.

Anyhow - I've put on the first computer eth1 (which is integrated MCP65) IPV4 setting to "Shared to Other Computers" and IPV6 to "Link-Local Computers" and while I was having Windows XP on the second machine, setting on it (the XP machine) DHCP (or how was it correctly called, when system automatically resolves or gets the IP and the rest what it needs?), second computer was receiving Internet signal and I could use both of them in such way.

Now the second computer is with Lubuntu and I thought that I could do the same way as did on XP - just put in Network Manager for the connection (eth0) everything to automatical and there will be internet, but there aren't and the manager shows some kind of "Automatic Ethernet" option, which after activation also doesn't do anything.

So my question in short would be: What do I have to do, to make my Lubuntu machine to recognize Ubuntu's eth1 and to use it as a source for Internet?

I wouldn't mind if someone would at least tell me how to correctly Google or search on LinuxQuestions forum for tips and How-To's!

Thanks in advance!

Last edited by zivs; 05-02-2010 at 06:01 AM.
 
Old 04-30-2010, 02:19 AM   #2
SuperJediWombat!
Member
 
Registered: Apr 2009
Location: Perth, Australia
Distribution: Ubuntu/CentOS
Posts: 208

Rep: Reputation: 51
I think this is a duplicate post, I read it earlier this week...

From the terminal of your ubuntu computer (the one connected to the internet) would you please run these commands and post the output to this forum.
Code:
sudo iptables-save
ifconfig
ip route
ps aux | grep dhcp

Last edited by SuperJediWombat!; 04-30-2010 at 05:57 AM. Reason: Missed a sudo (ubuntu..)
 
Old 04-30-2010, 04:04 AM   #3
zivs
Member
 
Registered: Jan 2005
Location: Ogre, Latvia
Distribution: Ubuntu 9.10
Posts: 72

Original Poster
Rep: Reputation: 15
That could be so, that it's already discussed before - it's just that I'm not that good at specific thing (like this one) searching. Also, I thought that if WinXP with dhcp could easily connect to internet through Ubuntu, so [easily] should do another Ubuntu system!

zivs@ubunts:~$ ifconfig
Quote:
eth0 Link encap:Ethernet HWaddr 00:08:54:51:36:79
inet addr:62.85.125.45 Bcast:62.85.125.255 Mask:255.255.255.0
inet6 addr: fe80::208:54ff:fe51:3679/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:4981660 errors:1 dropped:12 overruns:1 frame:0
TX packets:2978410 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2712432328 (2.7 GB) TX bytes:2532926121 (2.5 GB)
Interrupt:17 Base address:0xa000

eth1 Link encap:Ethernet HWaddr 00:1a:4d:9e:af:ad
inet addr:10.42.45.1 Bcast:10.42.45.255 Mask:255.255.255.0
inet6 addr: fe80::21a:4dff:fe9e:afad/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1034 errors:0 dropped:0 overruns:0 frame:0
TX packets:840 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:112003 (112.0 KB) TX bytes:90469 (90.4 KB)
Interrupt:26 Base address:0x4000

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:50061 errors:0 dropped:0 overruns:0 frame:0
TX packets:50061 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:2162511 (2.1 MB) TX bytes:2162511 (2.1 MB)

zivs@ubunts:~$ ip route
Quote:
10.42.45.0/24 dev eth1 proto kernel scope link src 10.42.45.1 metric 1
62.85.125.0/24 dev eth0 proto kernel scope link src 62.85.125.45 metric 1
169.254.0.0/16 dev eth1 scope link metric 1000
default via 62.85.125.1 dev eth0 proto static
zivs@ubunts:~$ ps aux | grep dhcp
Quote:
nobody 15356 0.0 0.0 19048 1108 ? S Apr29 0:00 /usr/sbin/dnsmasq --no-hosts --keep-in-foreground --bind-interfaces --no-poll --except-interface=lo --listen-address=10.42.45.1 --dhcp-range=10.42.45.10,10.42.45.100,60m --dhcp-option=option:router,10.42.45.1 --dhcp-lease-max=50 --pid-file=/var/run/nm-dnsmasq-eth1.pid
zivs 31761 0.0 0.0 7336 880 pts/0 S+ 12:02 0:00 grep dhcp

Last edited by zivs; 05-01-2010 at 05:49 AM.
 
Old 04-30-2010, 05:56 AM   #4
SuperJediWombat!
Member
 
Registered: Apr 2009
Location: Perth, Australia
Distribution: Ubuntu/CentOS
Posts: 208

Rep: Reputation: 51
Code:
sudo iptables-save
I need that one.

Can you run them all from the other ubuntu computer as well please?

Also on the other computer (without the internet), run
Code:
sudo dhclient
 
Old 04-30-2010, 01:48 PM   #5
zivs
Member
 
Registered: Jan 2005
Location: Ogre, Latvia
Distribution: Ubuntu 9.10
Posts: 72

Original Poster
Rep: Reputation: 15
iptables-save went with no messages, so I assumed that it's not needed to post that. Will check now the other computer!

Here are the results:
ilga@lubunts:~$ sudo dhclient
Quote:
Internet Systems Consortium DHCP Client V3.1.3
Copyright 2004-2009 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/eth0/00:0e:2e:c9:d0:2a
Sending on LPF/eth0/00:0e:2e:c9:d0:2a
Sending on Socket/fallback
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 7
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 13
and so on and on and on ...

Last edited by zivs; 04-30-2010 at 02:02 PM.
 
Old 04-30-2010, 07:32 PM   #6
SuperJediWombat!
Member
 
Registered: Apr 2009
Location: Perth, Australia
Distribution: Ubuntu/CentOS
Posts: 208

Rep: Reputation: 51
Please run all of these commands on the second computer.
Code:
sudo iptables-save
ifconfig
ip route
ping 10.42.45.1 -c 3
And please run
Code:
sudo iptables-save
from the first computer, and post anything that comes up
 
Old 05-01-2010, 05:48 AM   #7
zivs
Member
 
Registered: Jan 2005
Location: Ogre, Latvia
Distribution: Ubuntu 9.10
Posts: 72

Original Poster
Rep: Reputation: 15
Here's everything from the second computer (the one with no internet)

ilga@lubunts:~$ sudo iptables-save
ilga@lubunts:~$



ilga@lubunts:~$ ifconfig
Quote:
eth0 Link encap:Ethernet HWaddr 00:0e:2e:c9:d0:2a
inet6 addr: fe80::20e:2eff:fec9:d02a/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:1152 (1.1 KB)
Interrupt:11 Base address:0xec00

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:64 errors:0 dropped:0 overruns:0 frame:0
TX packets:64 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:4736 (4.7 KB) TX bytes:4736 (4.7 KB)

ilga@lubunts:~$ ip route
ilga@lubunts:~$




ilga@lubunts:~$ ps aux | grep dhcp
Quote:
ilga 1101 0.0 0.2 2276 792 pts/0 S+ 13:42 0:00 grep --color=auto dhcp


ilga@lubunts:~$ ping 10.42.45.1 -c 3
Quote:
connect: Network is unreachable
ilga@lubunts:~$
And here's from the computer with internet:

zivs@ubunts:~$ sudo iptables-save
Quote:
# Generated by iptables-save v1.4.4 on Sat May 1 13:46:13 2010
*nat
:PREROUTING ACCEPT [23771:3191793]
:POSTROUTING ACCEPT [206:11693]
:OUTPUT ACCEPT [42534:3476641]
-A POSTROUTING -o eth0 -j MASQUERADE
COMMIT
# Completed on Sat May 1 13:46:13 2010
# Generated by iptables-save v1.4.4 on Sat May 1 13:46:13 2010
*mangle
:PREROUTING ACCEPT [660212:505537910]
:INPUT ACCEPT [655795:505273275]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [474059:480258736]
:POSTROUTING ACCEPT [473832:480258444]
COMMIT
# Completed on Sat May 1 13:46:13 2010
# Generated by iptables-save v1.4.4 on Sat May 1 13:46:13 2010
*filter
:INPUT DROP [41:7364]
:FORWARD DROP [0:0]
:OUTPUT DROP [0:0]
:INBOUND - [0:0]
:LOG_FILTER - [0:0]
:LSI - [0:0]
:LSO - [0:0]
:OUTBOUND - [0:0]
-A INPUT -s 62.85.27.1/32 -p tcp -m tcp ! --tcp-flags FIN,SYN,RST,ACK SYN -j ACCEPT
-A INPUT -s 62.85.27.1/32 -p udp -j ACCEPT
-A INPUT -s 62.85.27.2/32 -p tcp -m tcp ! --tcp-flags FIN,SYN,RST,ACK SYN -j ACCEPT
-A INPUT -s 62.85.27.2/32 -p udp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p icmp -m limit --limit 10/sec -j ACCEPT
-A INPUT -d 255.255.255.255/32 -i eth0 -j DROP
-A INPUT -d 62.85.125.255/32 -j DROP
-A INPUT -s 224.0.0.0/8 -j DROP
-A INPUT -d 224.0.0.0/8 -j DROP
-A INPUT -s 255.255.255.255/32 -j DROP
-A INPUT -d 0.0.0.0/32 -j DROP
-A INPUT -m state --state INVALID -j DROP
-A INPUT -f -m limit --limit 10/min -j LSI
-A INPUT -i eth0 -j INBOUND
-A INPUT -d 10.42.43.1/32 -i eth1 -j INBOUND
-A INPUT -d 62.85.125.45/32 -i eth1 -j INBOUND
-A INPUT -d 10.42.43.255/32 -i eth1 -j INBOUND
-A INPUT -j LOG_FILTER
-A INPUT -j LOG --log-prefix "Unknown Input" --log-level 6
-A FORWARD -p icmp -m limit --limit 10/sec -j ACCEPT
-A FORWARD -p tcp -m tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu
-A FORWARD -i eth1 -j OUTBOUND
-A FORWARD -d 10.42.43.0/24 -p tcp -m state --state RELATED,ESTABLISHED -j ACCEPT
-A FORWARD -d 10.42.43.0/24 -p udp -m state --state RELATED,ESTABLISHED -j ACCEPT
-A FORWARD -j LOG_FILTER
-A FORWARD -j LOG --log-prefix "Unknown Forward" --log-level 6
-A OUTPUT -s 62.85.125.45/32 -d 62.85.27.1/32 -p tcp -m tcp --dport 53 -j ACCEPT
-A OUTPUT -s 62.85.125.45/32 -d 62.85.27.1/32 -p udp -m udp --dport 53 -j ACCEPT
-A OUTPUT -s 62.85.125.45/32 -d 62.85.27.2/32 -p tcp -m tcp --dport 53 -j ACCEPT
-A OUTPUT -s 62.85.125.45/32 -d 62.85.27.2/32 -p udp -m udp --dport 53 -j ACCEPT
-A OUTPUT -o lo -j ACCEPT
-A OUTPUT -s 224.0.0.0/8 -j DROP
-A OUTPUT -d 224.0.0.0/8 -j DROP
-A OUTPUT -s 255.255.255.255/32 -j DROP
-A OUTPUT -d 0.0.0.0/32 -j DROP
-A OUTPUT -m state --state INVALID -j DROP
-A OUTPUT -o eth0 -j OUTBOUND
-A OUTPUT -o eth1 -j OUTBOUND
-A OUTPUT -j LOG_FILTER
-A OUTPUT -j LOG --log-prefix "Unknown Output" --log-level 6
-A INBOUND -p tcp -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INBOUND -p udp -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INBOUND -j LSI
-A LSI -j LOG_FILTER
-A LSI -p tcp -m tcp --tcp-flags FIN,SYN,RST,ACK SYN -m limit --limit 1/sec -j LOG --log-prefix "Inbound " --log-level 6
-A LSI -p tcp -m tcp --tcp-flags FIN,SYN,RST,ACK SYN -j DROP
-A LSI -p tcp -m tcp --tcp-flags FIN,SYN,RST,ACK RST -m limit --limit 1/sec -j LOG --log-prefix "Inbound " --log-level 6
-A LSI -p tcp -m tcp --tcp-flags FIN,SYN,RST,ACK RST -j DROP
-A LSI -p icmp -m icmp --icmp-type 8 -m limit --limit 1/sec -j LOG --log-prefix "Inbound " --log-level 6
-A LSI -p icmp -m icmp --icmp-type 8 -j DROP
-A LSI -m limit --limit 5/sec -j LOG --log-prefix "Inbound " --log-level 6
-A LSI -j DROP
-A LSO -j LOG_FILTER
-A LSO -m limit --limit 5/sec -j LOG --log-prefix "Outbound " --log-level 6
-A LSO -j REJECT --reject-with icmp-port-unreachable
-A OUTBOUND -p icmp -j ACCEPT
-A OUTBOUND -p tcp -m state --state RELATED,ESTABLISHED -j ACCEPT
-A OUTBOUND -p udp -m state --state RELATED,ESTABLISHED -j ACCEPT
-A OUTBOUND -j ACCEPT
COMMIT
# Completed on Sat May 1 13:46:13 2010
zivs@ubunts:~$ sudo iptables-save
# Generated by iptables-save v1.4.4 on Sat May 1 13:46:19 2010
*nat
:PREROUTING ACCEPT [23784:3195135]
:POSTROUTING ACCEPT [206:11693]
:OUTPUT ACCEPT [42535:3476685]
-A POSTROUTING -o eth0 -j MASQUERADE
COMMIT
# Completed on Sat May 1 13:46:19 2010
# Generated by iptables-save v1.4.4 on Sat May 1 13:46:19 2010
*mangle
:PREROUTING ACCEPT [660295:505550152]
:INPUT ACCEPT [655877:505285422]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [474126:480263700]
:POSTROUTING ACCEPT [473899:480263408]
COMMIT
# Completed on Sat May 1 13:46:19 2010
# Generated by iptables-save v1.4.4 on Sat May 1 13:46:19 2010
*filter
:INPUT DROP [41:7364]
:FORWARD DROP [0:0]
:OUTPUT DROP [0:0]
:INBOUND - [0:0]
:LOG_FILTER - [0:0]
:LSI - [0:0]
:LSO - [0:0]
:OUTBOUND - [0:0]
-A INPUT -s 62.85.27.1/32 -p tcp -m tcp ! --tcp-flags FIN,SYN,RST,ACK SYN -j ACCEPT
-A INPUT -s 62.85.27.1/32 -p udp -j ACCEPT
-A INPUT -s 62.85.27.2/32 -p tcp -m tcp ! --tcp-flags FIN,SYN,RST,ACK SYN -j ACCEPT
-A INPUT -s 62.85.27.2/32 -p udp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p icmp -m limit --limit 10/sec -j ACCEPT
-A INPUT -d 255.255.255.255/32 -i eth0 -j DROP
-A INPUT -d 62.85.125.255/32 -j DROP
-A INPUT -s 224.0.0.0/8 -j DROP
-A INPUT -d 224.0.0.0/8 -j DROP
-A INPUT -s 255.255.255.255/32 -j DROP
-A INPUT -d 0.0.0.0/32 -j DROP
-A INPUT -m state --state INVALID -j DROP
-A INPUT -f -m limit --limit 10/min -j LSI
-A INPUT -i eth0 -j INBOUND
-A INPUT -d 10.42.43.1/32 -i eth1 -j INBOUND
-A INPUT -d 62.85.125.45/32 -i eth1 -j INBOUND
-A INPUT -d 10.42.43.255/32 -i eth1 -j INBOUND
-A INPUT -j LOG_FILTER
-A INPUT -j LOG --log-prefix "Unknown Input" --log-level 6
-A FORWARD -p icmp -m limit --limit 10/sec -j ACCEPT
-A FORWARD -p tcp -m tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu
-A FORWARD -i eth1 -j OUTBOUND
-A FORWARD -d 10.42.43.0/24 -p tcp -m state --state RELATED,ESTABLISHED -j ACCEPT
-A FORWARD -d 10.42.43.0/24 -p udp -m state --state RELATED,ESTABLISHED -j ACCEPT
-A FORWARD -j LOG_FILTER
-A FORWARD -j LOG --log-prefix "Unknown Forward" --log-level 6
-A OUTPUT -s 62.85.125.45/32 -d 62.85.27.1/32 -p tcp -m tcp --dport 53 -j ACCEPT
-A OUTPUT -s 62.85.125.45/32 -d 62.85.27.1/32 -p udp -m udp --dport 53 -j ACCEPT
-A OUTPUT -s 62.85.125.45/32 -d 62.85.27.2/32 -p tcp -m tcp --dport 53 -j ACCEPT
-A OUTPUT -s 62.85.125.45/32 -d 62.85.27.2/32 -p udp -m udp --dport 53 -j ACCEPT
-A OUTPUT -o lo -j ACCEPT
-A OUTPUT -s 224.0.0.0/8 -j DROP
-A OUTPUT -d 224.0.0.0/8 -j DROP
-A OUTPUT -s 255.255.255.255/32 -j DROP
-A OUTPUT -d 0.0.0.0/32 -j DROP
-A OUTPUT -m state --state INVALID -j DROP
-A OUTPUT -o eth0 -j OUTBOUND
-A OUTPUT -o eth1 -j OUTBOUND
-A OUTPUT -j LOG_FILTER
-A OUTPUT -j LOG --log-prefix "Unknown Output" --log-level 6
-A INBOUND -p tcp -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INBOUND -p udp -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INBOUND -j LSI
-A LSI -j LOG_FILTER
-A LSI -p tcp -m tcp --tcp-flags FIN,SYN,RST,ACK SYN -m limit --limit 1/sec -j LOG --log-prefix "Inbound " --log-level 6
-A LSI -p tcp -m tcp --tcp-flags FIN,SYN,RST,ACK SYN -j DROP
-A LSI -p tcp -m tcp --tcp-flags FIN,SYN,RST,ACK RST -m limit --limit 1/sec -j LOG --log-prefix "Inbound " --log-level 6
-A LSI -p tcp -m tcp --tcp-flags FIN,SYN,RST,ACK RST -j DROP
-A LSI -p icmp -m icmp --icmp-type 8 -m limit --limit 1/sec -j LOG --log-prefix "Inbound " --log-level 6
-A LSI -p icmp -m icmp --icmp-type 8 -j DROP
-A LSI -m limit --limit 5/sec -j LOG --log-prefix "Inbound " --log-level 6
-A LSI -j DROP
-A LSO -j LOG_FILTER
-A LSO -m limit --limit 5/sec -j LOG --log-prefix "Outbound " --log-level 6
-A LSO -j REJECT --reject-with icmp-port-unreachable
-A OUTBOUND -p icmp -j ACCEPT
-A OUTBOUND -p tcp -m state --state RELATED,ESTABLISHED -j ACCEPT
-A OUTBOUND -p udp -m state --state RELATED,ESTABLISHED -j ACCEPT
-A OUTBOUND -j ACCEPT
COMMIT
# Completed on Sat May 1 13:46:19 2010
zivs@ubunts:~$ clear

zivs@ubunts:~$ sudo iptables-save
# Generated by iptables-save v1.4.4 on Sat May 1 13:46:30 2010
*nat
:PREROUTING ACCEPT [23808:3202023]
:POSTROUTING ACCEPT [206:11693]
:OUTPUT ACCEPT [42538:3477045]
-A POSTROUTING -o eth0 -j MASQUERADE
COMMIT
# Completed on Sat May 1 13:46:30 2010
# Generated by iptables-save v1.4.4 on Sat May 1 13:46:30 2010
*mangle
:PREROUTING ACCEPT [660325:505557371]
:INPUT ACCEPT [655907:505292641]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [474134:480264393]
:POSTROUTING ACCEPT [473907:480264101]
COMMIT
# Completed on Sat May 1 13:46:30 2010
# Generated by iptables-save v1.4.4 on Sat May 1 13:46:30 2010
*filter
:INPUT DROP [41:7364]
:FORWARD DROP [0:0]
:OUTPUT DROP [0:0]
:INBOUND - [0:0]
:LOG_FILTER - [0:0]
:LSI - [0:0]
:LSO - [0:0]
:OUTBOUND - [0:0]
-A INPUT -s 62.85.27.1/32 -p tcp -m tcp ! --tcp-flags FIN,SYN,RST,ACK SYN -j ACCEPT
-A INPUT -s 62.85.27.1/32 -p udp -j ACCEPT
-A INPUT -s 62.85.27.2/32 -p tcp -m tcp ! --tcp-flags FIN,SYN,RST,ACK SYN -j ACCEPT
-A INPUT -s 62.85.27.2/32 -p udp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p icmp -m limit --limit 10/sec -j ACCEPT
-A INPUT -d 255.255.255.255/32 -i eth0 -j DROP
-A INPUT -d 62.85.125.255/32 -j DROP
-A INPUT -s 224.0.0.0/8 -j DROP
-A INPUT -d 224.0.0.0/8 -j DROP
-A INPUT -s 255.255.255.255/32 -j DROP
-A INPUT -d 0.0.0.0/32 -j DROP
-A INPUT -m state --state INVALID -j DROP
-A INPUT -f -m limit --limit 10/min -j LSI
-A INPUT -i eth0 -j INBOUND
-A INPUT -d 10.42.43.1/32 -i eth1 -j INBOUND
-A INPUT -d 62.85.125.45/32 -i eth1 -j INBOUND
-A INPUT -d 10.42.43.255/32 -i eth1 -j INBOUND
-A INPUT -j LOG_FILTER
-A INPUT -j LOG --log-prefix "Unknown Input" --log-level 6
-A FORWARD -p icmp -m limit --limit 10/sec -j ACCEPT
-A FORWARD -p tcp -m tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu
-A FORWARD -i eth1 -j OUTBOUND
-A FORWARD -d 10.42.43.0/24 -p tcp -m state --state RELATED,ESTABLISHED -j ACCEPT
-A FORWARD -d 10.42.43.0/24 -p udp -m state --state RELATED,ESTABLISHED -j ACCEPT
-A FORWARD -j LOG_FILTER
-A FORWARD -j LOG --log-prefix "Unknown Forward" --log-level 6
-A OUTPUT -s 62.85.125.45/32 -d 62.85.27.1/32 -p tcp -m tcp --dport 53 -j ACCEPT
-A OUTPUT -s 62.85.125.45/32 -d 62.85.27.1/32 -p udp -m udp --dport 53 -j ACCEPT
-A OUTPUT -s 62.85.125.45/32 -d 62.85.27.2/32 -p tcp -m tcp --dport 53 -j ACCEPT
-A OUTPUT -s 62.85.125.45/32 -d 62.85.27.2/32 -p udp -m udp --dport 53 -j ACCEPT
-A OUTPUT -o lo -j ACCEPT
-A OUTPUT -s 224.0.0.0/8 -j DROP
-A OUTPUT -d 224.0.0.0/8 -j DROP
-A OUTPUT -s 255.255.255.255/32 -j DROP
-A OUTPUT -d 0.0.0.0/32 -j DROP
-A OUTPUT -m state --state INVALID -j DROP
-A OUTPUT -o eth0 -j OUTBOUND
-A OUTPUT -o eth1 -j OUTBOUND
-A OUTPUT -j LOG_FILTER
-A OUTPUT -j LOG --log-prefix "Unknown Output" --log-level 6
-A INBOUND -p tcp -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INBOUND -p udp -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INBOUND -j LSI
-A LSI -j LOG_FILTER
-A LSI -p tcp -m tcp --tcp-flags FIN,SYN,RST,ACK SYN -m limit --limit 1/sec -j LOG --log-prefix "Inbound " --log-level 6
-A LSI -p tcp -m tcp --tcp-flags FIN,SYN,RST,ACK SYN -j DROP
-A LSI -p tcp -m tcp --tcp-flags FIN,SYN,RST,ACK RST -m limit --limit 1/sec -j LOG --log-prefix "Inbound " --log-level 6
-A LSI -p tcp -m tcp --tcp-flags FIN,SYN,RST,ACK RST -j DROP
-A LSI -p icmp -m icmp --icmp-type 8 -m limit --limit 1/sec -j LOG --log-prefix "Inbound " --log-level 6
-A LSI -p icmp -m icmp --icmp-type 8 -j DROP
-A LSI -m limit --limit 5/sec -j LOG --log-prefix "Inbound " --log-level 6
-A LSI -j DROP
-A LSO -j LOG_FILTER
-A LSO -m limit --limit 5/sec -j LOG --log-prefix "Outbound " --log-level 6
-A LSO -j REJECT --reject-with icmp-port-unreachable
-A OUTBOUND -p icmp -j ACCEPT
-A OUTBOUND -p tcp -m state --state RELATED,ESTABLISHED -j ACCEPT
-A OUTBOUND -p udp -m state --state RELATED,ESTABLISHED -j ACCEPT
-A OUTBOUND -j ACCEPT
COMMIT
# Completed on Sat May 1 13:46:30 2010
 
Old 05-01-2010, 09:29 AM   #8
SuperJediWombat!
Member
 
Registered: Apr 2009
Location: Perth, Australia
Distribution: Ubuntu/CentOS
Posts: 208

Rep: Reputation: 51
From the computer with the internet connection, please run this command:
Code:
sudo iptables -I INPUT -i eth1 -j ACCEPT
Then, from your second computer please run
Code:
sudo dhclient
And post the output.

----

If that does NOT work please setup a static IP address for your second computer, in the 10.42.45.0/24 network.
IP address: 10.42.45.100
Subnetmask: 255.255.255.0
Default Gateway: 10.42.45.1
Use your ISP's DNS server.

Once you have set that, ping 10.42.45.1 from the second computer. If that works, ping 203.0.178.191 as well.

---
Please also do this from the main ubuntu computer and post the output:
Code:
ip route
ps aux | grep dhcp
cat /etc/resolv.conf
cat /proc/sys/net/ipv4/ip_forward

Last edited by SuperJediWombat!; 05-01-2010 at 09:31 AM.
 
Old 05-01-2010, 05:34 PM   #9
zivs
Member
 
Registered: Jan 2005
Location: Ogre, Latvia
Distribution: Ubuntu 9.10
Posts: 72

Original Poster
Rep: Reputation: 15
Tried/did all the commands You told me to do, but still no results - no connection on second computer ..

Here's the info from second computer:
ilga@lubunts:~$ sudo dhclient
Quote:
Internet Systems Consortium DHCP Client V3.1.3
Copyright 2004-2009 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/eth0/00:0e:2e:c9:d0:2a
Sending on LPF/eth0/00:0e:2e:c9:d0:2a
Sending on Socket/fallback
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 3
DHCPOFFER of 10.42.43.10 from 10.42.43.1
DHCPREQUEST of 10.42.43.10 on eth0 to 255.255.255.255 port 67
DHCPACK of 10.42.43.10 from 10.42.43.1
bound to 10.42.43.10 -- renewal in 1716 seconds.
Also, pinging 10.42.45.1 ended with Network is unreachable message ..

And here's from main computer:
zivs@ubunts:~$ ip route
Quote:
10.42.43.0/24 dev eth1 proto kernel scope link src 10.42.43.1 metric 1
62.85.125.0/24 dev eth0 proto kernel scope link src 62.85.125.45 metric 1
169.254.0.0/16 dev eth0 scope link metric 1000
default via 62.85.125.1 dev eth0 proto static

zivs@ubunts:~$ ps aux | grep dhcp
Quote:
nobody 2921 0.0 0.0 19048 1184 ? S 01:18 0:00 /usr/sbin/dnsmasq --no-hosts --keep-in-foreground --bind-interfaces --no-poll --except-interface=lo --listen-address=10.42.43.1 --dhcp-range=10.42.43.10,10.42.43.100,60m --dhcp-option=option:router,10.42.43.1 --dhcp-lease-max=50 --pid-file=/var/run/nm-dnsmasq-eth1.pid
zivs 3394 0.0 0.0 7336 884 pts/0 S+ 01:26 0:00 grep dhcp

zivs@ubunts:~$ cat /etc/resolv.conf
Quote:
# Generated by NetworkManager
nameserver 62.85.27.1
nameserver 62.85.27.2

zivs@ubunts:~$ cat /proc/sys/net/ipv4/ip_forward
Quote:
1
 
Old 05-01-2010, 07:54 PM   #10
SuperJediWombat!
Member
 
Registered: Apr 2009
Location: Perth, Australia
Distribution: Ubuntu/CentOS
Posts: 208

Rep: Reputation: 51
Yay. The ping didn't work because for some reason your ubuntu box changed it's internal IP address from 10.42.45.1 to 10.42.43.1

The reason that DHCP did not work earlier is that you were blocking it from your firewall. Either add the iptables command I gave you earlier to your firewall script, or stick at the end of rc.local (or something similar.)

Set the lubuntu computer back to DHCP, and try to use the internet.

Good luck!
 
1 members found this post helpful.
Old 05-02-2010, 06:00 AM   #11
zivs
Member
 
Registered: Jan 2005
Location: Ogre, Latvia
Distribution: Ubuntu 9.10
Posts: 72

Original Poster
Rep: Reputation: 15
Thanks,SuperJediWombat! - after adding that iptables command on my Ubuntu machine and then running dhclient command on the other computer (Also, putting IPv4 to Automatic and IPv6 to Link-Local Only), I've finally got the Internet on both machines!

Only thing which I noticed just now was that in Network-Manager on Lubuntu computer wasn't written Mac address (which I copied out from ifconfig's info) ... I wonder if that missing Mac address there was also playing any role in this case?

Once again - huge thanks for putting so much effort in finding the problem for me!
 
Old 05-02-2010, 06:04 AM   #12
SuperJediWombat!
Member
 
Registered: Apr 2009
Location: Perth, Australia
Distribution: Ubuntu/CentOS
Posts: 208

Rep: Reputation: 51
No problem, I'm glad we got it sorted. Where did those iptables rules come from by the way? Did you set them up manually, or are they part of the Ubuntu network sharing system?
 
Old 05-02-2010, 07:11 AM   #13
zivs
Member
 
Registered: Jan 2005
Location: Ogre, Latvia
Distribution: Ubuntu 9.10
Posts: 72

Original Poster
Rep: Reputation: 15
I haven't touched them before (if only Firestarter after installation (don't know why I had it installed) rewrote something?), so I guess that's part of Ubuntu's system.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
connecting to internet from ubuntu dbkmurthy Ubuntu 6 03-08-2010 11:49 PM
Connecting to internet via ubuntu 9.04 adithya24 Linux - Networking 2 08-11-2009 11:17 PM
Connecting Ubuntu 9.04 to a router via a windows machine sjhart Linux - Newbie 1 06-12-2009 12:51 PM
Help with Connecting to Internet - Ubuntu tjd50 Linux - General 8 09-04-2008 03:29 AM
[beginner] Connecting fedora core to internet through winXP machine RhysBJ Linux - Networking 8 06-09-2006 08:03 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 12:29 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration