LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 02-06-2010, 12:38 AM   #1
MrCode
Member
 
Registered: Aug 2009
Location: Oregon, USA
Distribution: Arch
Posts: 864
Blog Entries: 31

Rep: Reputation: 148Reputation: 148
Trying to share Internet between Ubuntu and Arch, failing to keep settings


Hi, all. As you may have guessed by the title, I'm trying to share an internet connection between my current Ubuntu machine and another machine running Arch (used to be Puppy, got tired of fighting with it, so I decided to go KISS).

I've got the machines connected by way of a crossover cable, and the Ubuntu machine has a wireless connection to the router, which goes to the modem (and thus the Internet ).

The problem I'm having is in trying to adapt the Arch Wiki's instructions for sharing an internet connection betwen two computers, to suit my configuration (the tutorial assumes both machines are running Arch, when mine are not).

I've used the following commands:

On the Ubuntu machine (linuxbox):

Code:
root@linuxbox:~# ifconfig eth0 192.168.0.1 netmask 255.255.255.0
root@linuxbox:~# ifconfig eth0 up
root@linuxbox:~# echo 1 > /proc/sys/net/ipv4/ip_forward
root@linuxbox:~# iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
On the Arch machine (archie):

Code:
[root@archie ~]# ifconfig eth0 192.168.0.2 netmask 255.255.255.0
[root@archie ~]# ifconfig eth0 up
[root@archie ~]# route add default gw 192.168.0.1 eth0
[root@archie ~]# echo "nameserver 68.87.73.246" >> resolv.conf
[root@archie ~]# echo "nameserver 68.87.71.230" >> resolv.conf
The last two of archie's commands have the same DNS server addresses as linuxbox's resolv.conf.

This seems to get things working, as I can:

Code:
[root@archie ~]# ping 192.168.0.1
PING 192.168.0.1 (192.168.0.1) 56(84) bytes of data.
64 bytes from 192.168.0.1 icmp_seq=1 ttl-64 time=1.38 ms
64 bytes from 192.168.0.1 icmp_seq=2 ttl-64 time=0.122 ms
64 bytes from 192.168.0.1 icmp_seq=3 ttl-64 time=0.119 ms
^C
--- 192.168.0.1 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2001ms
rtt min/avg/max/mdev = 0.119/0.542/1.387/0.597 ms
[root@archie ~]# ping www.yahoo.com
PING www-real.wa1.b.yahoo.com (69.147.76.15) 56(84) bytes of data.
64 bytes from f1.www.vip.re1.yahoo.com (69.147.76.15) icmp_seq=1 ttl-52 time=23.9 ms
64 bytes from f1.www.vip.re1.yahoo.com (69.147.76.15) icmp_seq=1 ttl-52 time=22.2 ms
^C
--- www-real.wa1.b.yahoo.com ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 10001ms
rtt min/avg/max/mdev = 22.212/23.844/23.957/0.885 ms
[root@archie ~]#
However, when I reboot archie, I'm back to square one. I find it easier to re-install Arch just so I can get a nice clean slate to re-configure. I don't see anything in the tutorial that shows how to make this permanent for the 2nd computer (in my case archie).

Last edited by MrCode; 02-06-2010 at 05:14 AM. Reason: edited ping results to be exactly what was output on Arch machine
 
Old 02-06-2010, 05:50 AM   #2
HasC
Member
 
Registered: Oct 2009
Location: South America - Paraguay
Distribution: Debian 5 - Slackware 13.1 - Arch - Some others linuxes/*BSDs through KVM and Xen
Posts: 329

Rep: Reputation: 55
Well, I don't know about Arch, so I can't tell you where are its configuration files. But they should be somewhere, 'cause I really doubt that such a popular distro doesn't have a way to store networking configurations (or any other configurations). It's up to you to find that.

In the meantime, what about writing a little shell script which can do all that work for you?
 
Old 02-06-2010, 06:09 AM   #3
carbonfiber
Member
 
Registered: Sep 2009
Location: Sparta
Posts: 237

Rep: Reputation: 46
Perhaps one of these can help: http://wiki.archlinux.org/index.php/Netcfg ; http://wiki.archlinux.org/index.php/Configuring_Network
 
Old 02-06-2010, 10:40 PM   #4
MrCode
Member
 
Registered: Aug 2009
Location: Oregon, USA
Distribution: Arch
Posts: 864

Original Poster
Blog Entries: 31

Rep: Reputation: 148Reputation: 148
Quote:
Originally Posted by HasC
In the meantime, what about writing a little shell script which can do all that work for you?
I have actually done that, but I don't know where to put it to have it start at bootup (I'm looking at the wiki article on the Arch boot process, and I'm not seeing any way of simply sticking a script in a particular folder to make it run at boot). (Turns out I really don't have to reinstall Arch to get it working after a reboot)

Plus which, I have to do the steps on both machines in order for it to work.

Searching the forums turns up no information (that's the Arch forums and LQ), and Google can't seem to help, either.

Last edited by MrCode; 02-06-2010 at 10:41 PM.
 
Old 02-08-2010, 06:38 AM   #5
MrCode
Member
 
Registered: Aug 2009
Location: Oregon, USA
Distribution: Arch
Posts: 864

Original Poster
Blog Entries: 31

Rep: Reputation: 148Reputation: 148
UPDATE: Solved, mostly. Turns out I simply didn't know enough about what I was doing in /etc/rc.conf, and so I went ahead and did another clean reinstall, and now I've got the configuration set up properly for archie.

My rc.conf:

Code:
#
# /etc/rc.conf - Main Configuration for Arch Linux
#

# -----------------------------------------------------------------------
# LOCALIZATION
# -----------------------------------------------------------------------
#
# LOCALE: available languages can be listed with the 'locale -a' command
# HARDWARECLOCK: set to "UTC" or "localtime"
# USEDIRECTISA: use direct I/O requests instead of /dev/rtc for hwclock
# TIMEZONE: timezones are found in /usr/share/zoneinfo
# KEYMAP: keymaps are found in /usr/share/kbd/keymaps
# CONSOLEFONT: found in /usr/share/kbd/consolefonts (only needed for non-US)
# CONSOLEMAP: found in /usr/share/kbd/consoletrans
# USECOLOR: use ANSI color sequences in startup messages
#
LOCALE="en_US.utf8"
HARDWARECLOCK="UTC"
USEDIRECTISA="no"
TIMEZONE="America/New_York"
KEYMAP="us"
CONSOLEFONT=
CONSOLEMAP=
USECOLOR="yes"

# -----------------------------------------------------------------------
# HARDWARE
# -----------------------------------------------------------------------
#
# MOD_AUTOLOAD: Allow autoloading of modules at boot and when needed
# MOD_BLACKLIST: Prevent udev from loading these modules
# MODULES: Modules to load at boot-up. Prefix with a ! to blacklist.
#
# NOTE: Use of 'MOD_BLACKLIST' is deprecated. Please use ! in the MODULES array.
#
MOD_AUTOLOAD="yes"
#MOD_BLACKLIST=() #deprecated
MODULES=()

# Scan for LVM volume groups at startup, required if you use LVM
USELVM="no"

# -----------------------------------------------------------------------
# NETWORKING
# -----------------------------------------------------------------------
#
# HOSTNAME: Hostname of machine. Should also be put in /etc/hosts
#
HOSTNAME="archie"

# Use 'ifconfig -a' or 'ls /sys/class/net/' to see all available interfaces.
#
# Interfaces to start at boot-up (in this order)
# Declare each interface then list in INTERFACES
#   - prefix an entry in INTERFACES with a ! to disable it
#   - no hyphens in your interface names - Bash doesn't like it
# 
# DHCP:     Set your interface to "dhcp" (eth0="dhcp")
# Wireless: See network profiles below
#

#Static IP example
eth0="eth0 192.168.0.2 netmask 255.255.255.0"
INTERFACES=(eth0)

# Routes to start at boot-up (in this order)
# Declare each route then list in ROUTES
#   - prefix an entry in ROUTES with a ! to disable it
#
gateway="default gw 192.168.0.1 eth0"
ROUTES=(gateway)
 
# Enable these network profiles at boot-up.  These are only useful
# if you happen to need multiple network configurations (ie, laptop users)
#   - set to 'menu' to present a menu during boot-up (dialog package required)
#   - prefix an entry with a ! to disable it
#
# Network profiles are found in /etc/network.d
#
# This now requires the netcfg package
#
#NETWORKS=(main)

# -----------------------------------------------------------------------
# DAEMONS
# -----------------------------------------------------------------------
#
# Daemons to start at boot-up (in this order)
#   - prefix a daemon with a ! to disable it
#   - prefix a daemon with a @ to start it up in the background
#
DAEMONS=(syslog-ng network netfs crond)
The only thing I have to do manually is enable the network on linuxbox's side, for whatever reason, but I've got that down to a shell script.

Last edited by MrCode; 02-08-2010 at 06:43 AM.
 
  


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
[SOLVED] Win2K Pro to Share Internet With Ubuntu soplin Linux - Networking 3 04-15-2009 06:07 PM
how to share internet in ubuntu 8.4 bhupi842 Linux - Networking 2 11-05-2008 08:23 AM
all settings correct for internet conection, but ubuntu 7.10 still does not connect papara Linux - Newbie 2 06-16-2008 04:36 PM
need settings for moto q9 for internet connection for Ubuntu billrandle Ubuntu 0 05-07-2008 12:45 AM
share dial-up internet from xp to ubuntu StewieG Linux - Networking 2 06-16-2005 01:21 AM

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

All times are GMT -5. The time now is 05:59 AM.

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