[SLUG] Dual NIC on Arch Linux system

From: Chuck Hast (wchast@gmail.com)
Date: Mon Dec 28 2009 - 11:39:46 EST


Folks,
I need to set up a 2nd NIC card on a Arch Linux system, I have been looking
at the docs and not sure exactly how to handle it, but here is what I want to
do.

NIC #1 = eth0
This will be a DHCP client (maybe static but I am generally finding it easier
to tell the hosting router to assign a fixed IP based on MAC) This part is
working, it talks to the outside world just fine.

NIC #2 = eth1
This will be a dedicated network of IP cameras, I am presently using a
router to do the DHCP function, but I want to move this functionality to the
server, so I am going to try to use dncmasq to do the dhcp server function,
it will assign IP addresses to the cameras on the dedicated network.

Here is the issue, I am looking at all of the documentation, but find nothing
that gives me examples of a setup which has as one port a dhcp client, and
on the 2nd port a static IP and dhcp server. So before I start breaking and
fixing I thought I would pick your brains and see if any of you have tried to
do the sort of thing. This is sort of like setting up a linux router, where the
public side is set up as a dhcp client, and the private side is a dhcp server
but the Arch linux docs for that are still evolving, so they have nothing clear
on the proper setup.

Here is the present setup for the two nic cards on the machine in question
taken from the rc.conf file:

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

# 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
#
eth0="dhcp"
eth1="dhcp"
INTERFACES=(eth0 eth1)

# 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"
ROUTES=(!gateway)
-----------------------------------------------------EoF----------------------------
I believe that all having to do with eth0 is OK, I need to set
up eth1, it will be a static address, I think I know how to set
up the static part of it, but I do not want that to get in a pissing
contest with dnsmasq. I am not sure but I believe that there
maybe some conflicting instructions between dnsmasq.conf
and rc.conf. as to the set up of the port of interest (eth1)

So summarizing:
I want eth0 to continue has it has requesting a dhcp assigment
but I want eth1 to provide dhcp addresses to the clients which
will be on that network (cameras) No need for anything but dhcp
as the cameras only need to send the video to the server.

Here is my first poke at it:
--------------------------------------------------SoF----------------------------------------------------
# -----------------------------------------------------------------------
# NETWORKING
# -----------------------------------------------------------------------
#
# HOSTNAME: Hostname of machine. Should also be put in /etc/hosts
#
HOSTNAME="zmhost01"

# 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
#
eth0="dhcp"
eth1="eth0 172.31.0.1 netmask 255.255.255.0 broadcast 172.31.0.255"
INTERFACES=(eth0 eth1)

# 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"
ROUTES=(!gateway)
-----------------------------------------------------EoF----------------------------

I am all ears.

-- 
Chuck Hast  -- KP4DJT --
To paraphrase my flight instructor;
"the only dumb question is the one you DID NOT ask resulting in my going
out and having to identify your bits and pieces in the midst of torn
and twisted metal."
-----------------------------------------------------------------------
This list is provided as an unmoderated internet service by Networked
Knowledge Systems (NKS).  Views and opinions expressed in messages
posted are those of the author and do not necessarily reflect the
official policy or position of NKS or any of its employees.



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 14:22:06 EDT