Gentoo Archives: gentoo-server

From: peter.gantner@×××××××××××××.at
To: gentoo-server@l.g.o
Subject: Re: [gentoo-server] virrtual network devices?
Date: Fri, 21 Oct 2005 05:26:52
Message-Id: Pine.LNX.4.64.0510210714130.915@scourge.crownest.net
In Reply to: [gentoo-server] virrtual network devices? by Christian Parpart
1 Quoth Christian Parpart (on Friday, the 21st of October):
2
3 > hi,
4 >
5 > is this even possible?
6 >
7 > I mean, I want somethiing like lo/loopback but definitely *not* for
8 > 127.0.0.0/8, instead, I'd like to configure a virtual networking device
9 > having e.g. configured for 192.168.42.1/24 (on a server that has only *one*
10 > single physical networking interface with a public IP), so, that I can use
11 > this subnet on the virtual networking interface to let VPN clients connect to
12 > it.
13
14 You can assign a second address (alias) to your existing interface.
15 It will be named eth0:X and can have any address you wish
16
17 Gentoos /etc/conf.d/net has that possibility already built in, just ad a
18 second line to your existing setup like so:
19
20 config_eth0=(
21 "84.115.XXX.XXX netmask 255.255.255.0"
22 "192.168.1.1 netmask 255.255.255.0"
23 )
24
25 and restart networking.
26
27 Minor drawback though: you cannot address the aliased interface with
28 iptables, iptables -i/-o will only take the physical network device.
29 Filtering via IP still works though.
30
31 The other possibility is to use the dummy module (config option
32 CONFIG_DUMMY=m under Device drivers -> Network device support)
33 which will create as many virtual networking interfaces as you want,
34 called dummy0, dummy1 ...
35 (modprobe dummy numdummies=N, ifconfig dummy)
36
37 HTH,
38 Peter
39
40 --
41 "I do not think the way you think I think."
42 -- Kai, last of the Brunnen G
43 --
44 gentoo-server@g.o mailing list