FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 09-27-2010, 02:54 PM
Mark Neidorff
 
Default Change to 2 interfaces on 1 NIC?

Hi all,

I currently have my 6+ year old server (web, e-mail, firewall, local lan)
running with 2 NICs, one coming from the DSL router (on the 192.168.2.x lan)
and the other connected to the local lan (192.168.1.x). (all local users get
their mail, web surfing and firewall services from my box) I only use static
IP addresses. This server is a big, old and noisy box and I want to use a
small, quiet mini-itx box in its place. The new mini-itx box that I just
bought has only 1 NIC port. The example for setting up multiple IP addresses
from the network configuration page looks like this:

auto eth0
iface eth0 inet static
address 192.168.1.42
netmask 255.255.255.0
broadcast 192.168.1.255
gateway 192.168.1.1

auto eth0:0
iface eth0:0 inet static
address 192.168.1.41
netmask 255.255.255.0
broadcast 192.168.1.255

auto eth0:1
iface eth0:1 inet static
address 192.168.1.44
netmask 255.255.255.0
broadcast 192.168.1.255

This is the way my current 2 NICs are configured (yes, the config is from RH,
but the concepts are the same):
#eth0 connects to the router
DEVICE=eth0
BOOTPROTO=static
IPADDR=192.168.2.2
NETMASK=255.255.255.0
GATEWAY=192.168.2.1
ONBOOT=yes

#eth1 connects to the local lan
DEVICE=eth1
BOOTPROTO=static
BROADCAST=192.168.1.255
IPADDR=192.168.1.1
NETMASK=255.255.255.0
NETWORK=192.168.1.0
ONBOOT=yes

My questions:
1. Are all 3 of the interfaces shown usable, or does the first "auto eth0"
define the NIC for the others?
2. Can I put an address like 192.168.2.2 for one "iface" (like eth:0) and
192.168.1.1 for another (eth0:1) or will this not work, and I will need a
mini-itx with 2 NICs?

thanks,

Mark


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 201009271054.40011.mark@neidorff.com">http://lists.debian.org/201009271054.40011.mark@neidorff.com
 
Old 09-27-2010, 03:17 PM
"Jesús M. Navarro"
 
Default Change to 2 interfaces on 1 NIC?

Hi, Mark:

On Monday 27 September 2010 16:54:39 Mark Neidorff wrote:
> Hi all,
>
> I currently have my 6+ year old server (web, e-mail, firewall, local lan)
> running with 2 NICs, one coming from the DSL router (on the 192.168.2.x
> lan) and the other connected to the local lan (192.168.1.x). (all local
> users get their mail, web surfing and firewall services from my box) I only
> use static IP addresses. This server is a big, old and noisy box and I want
> to use a small, quiet mini-itx box in its place. The new mini-itx box that
> I just bought has only 1 NIC port.

[...]

> This is the way my current 2 NICs are configured (yes, the config is from
> RH, but the concepts are the same):
> #eth0 connects to the router
> DEVICE=eth0
> BOOTPROTO=static
> IPADDR=192.168.2.2
> NETMASK=255.255.255.0
> GATEWAY=192.168.2.1
> ONBOOT=yes
>
> #eth1 connects to the local lan
> DEVICE=eth1
> BOOTPROTO=static
> BROADCAST=192.168.1.255
> IPADDR=192.168.1.1
> NETMASK=255.255.255.0
> NETWORK=192.168.1.0
> ONBOOT=yes
>
> My questions:
> 1. Are all 3 of the interfaces shown usable, or does the first "auto eth0"
> define the NIC for the others?

You have currently defined only two interfaces; using three is "just" an
example. But, yes, multiple definitions for a single physical interface does
work provided everything is properly configured.

> 2. Can I put an address like 192.168.2.2 for one "iface" (like eth:0) and
> 192.168.1.1 for another (eth0:1) or will this not work, and I will need a
> mini-itx with 2 NICs?

You should define them as eth0 and eth0:0 or, even better, use the "new"
iptools to define the different IP configs; something like this:

auto eth0
iface eth0 inet static
address 192.168.2.2
netmask 255.255.255.0
gateway 192.168.2.1
up ip addr add 192.168.1.1/24 dev $IFACE
down ip addr del 192.168.1.1/32 dev $IFACE
(yes: the netmask from the 'up' and 'down' stanzas are different)

On top of this, you obviously would need to configure ip routing with
something like:
echo "1" > /proc/sys/net/ipv4/ip_forward 1
And, as needed, iptables rules for NAT'ing, filtering, etc.

This said, I'd counsel that you should not go this path and get two NICs if at
all possible. These kind of "two networks on an interface", specially when
routing/firewalling/nating is involved, is prone to all kinds of weird
problems (usually related to MAC-broadcasting/redirecting).

Cheers.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 201009271717.28936.jesus.navarro@undominio.net">ht tp://lists.debian.org/201009271717.28936.jesus.navarro@undominio.net
 
Old 09-27-2010, 04:26 PM
Klistvud
 
Default Change to 2 interfaces on 1 NIC?

Dne, 27. 09. 2010 17:17:28 je Jesús M. Navarro napisal(a):
This said, I'd counsel that you should not go this path and get two
NICs if at

all possible.


+1

--
Regards,

Klistvud
Certifiable Loonix User #481801
http://bufferoverflow.tiddlyspot.com

Please reply to the list, not to me.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 1285604790.8467.2@compax">http://lists.debian.org/1285604790.8467.2@compax
 

Thread Tools




All times are GMT. The time now is 09:49 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org