You are not logged in.

#1 2013-03-27 17:40:58

leonarddr
Member
Registered: 2013-03-27
Posts: 6

Creating eth0:0 alias with netcfg

Hello,

I have a LiNode VPS running Arch. The following config works fine, using the ipv4, ipv6 external ip's and the internal ip for the linode network

nano main
CONNECTION='ethernet'
DESCRIPTION='A more versatile static ethernet connection using iproute'
INTERFACE='eth0'
IP='static'
ADDR=176.1.2.3
NETMASK=255.255.255.0
GATEWAY=176.1.2.1
IPCFG=('addr add dev eth0 192.168.1.2/17')
IP6='static'
ADDR6=(2a01:1234::5678:9abc:def0:1234/64)
GATEWAY6=fe80::1
ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 176.1.2.3  netmask 255.255.255.0  broadcast 176.58.109.255
        inet6 2a01:1234::5678:9abc:def0:1234/64  prefixlen 64  scopeid 0x0<global>
        inet6 fe80::f03c:91ff:feae:38af  prefixlen 64  scopeid 0x20<link>
        ether f2:3c:91:ae:38:af  txqueuelen 1000  (Ethernet)
        RX packets 7933  bytes 4141149 (3.9 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 5522  bytes 1704463 (1.6 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 70  

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 16436
...

I want the 192.168.1.2 address on the eth0:0 alias. How to accomplish this?

Thanks, Leonard

Last edited by leonarddr (2013-03-29 07:16:40)

Offline

#2 2013-03-29 04:57:19

linuxbeetle
Member
Registered: 2013-02-27
Posts: 3

Re: Creating eth0:0 alias with netcfg

not sure how you have your network is  setup
but you have the first three octects the same as your gateway
depding on the routing table. if there is a pc that you want service from
I'm not sure but I think you do a port forward. any body else feel free
to correct me.

Offline

#3 2013-03-29 09:55:31

akerl
Member
Registered: 2013-03-29
Posts: 1

Re: Creating eth0:0 alias with netcfg

Hi, fellow Linodian!

The "0" after the colon in "eth0:0" is a label, and can be pretty much anything. You can set it via the "label" parameter in "ip addr add", as follows (note that it wants the interface included as part of the label):

"ip addr add dev eth0 label eth0:0 192.168.1.2/17"

That can be dropped into your IPCFG (without the "ip " of course).

- Les

Offline

#4 2013-03-29 09:59:42

leonarddr
Member
Registered: 2013-03-27
Posts: 6

Re: Creating eth0:0 alias with netcfg

Fine, that solves my issue. Many thanks!

Offline

Board footer

Powered by FluxBB