1

Good day, I am trying to set up network subinterfaces for my IP address using ifconfig. Also i need to configure network interfaces in the Linux sysfile.

I know the manual for ifconfig but i am having troubles with its config. Should it be like...

ifconfig 1xx.xxx.xxx.xxx netmask 255.255.255.0

...or am i missing something?

Thanks for replies, also am i doing the bind9 dns configuration right? name.conf.local adding at the end:

zone "202.168.192.in-addr.arpa" {
type master;
file "/etc/bind/202.168.192.in-addr.arpa";
};
zone "201.168.192.in-addr.arpa" {
type master;
file "/etc/bind/201.168.192.in-addr.arpa";
};
zone "my.domain" {
type master;
file "/etc/bind/my.domain";
};

where my.domain is name of my domain (well, kinda obvious)

now creating the 202.168.192.in-addr.arpa file

$TTL 1s
@ IN SOA localhost. root.localhost. (
1 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS localhost.
000 IN PTR localhost.
000 IN PTR hostn1
000 IN PTR hostn2

where 000 is last byte of my address

Similar for 201.168.192.in-addr.arpa

; BIND reverse data file for local loopback interface
;
$TTL 1s
@ IN SOA localhost. root.localhost. (
1 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS localhost.
XXX IN PTR localhost.
XXX IN PTR host1
XXY IN PTR host2

and for the my.domain file

;
; BIND data file for local loopback interface
;
$TTL 1s
@ IN SOA ns.my.domain. root.ns.my.domain. (
1 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
IN NS ns
localhost IN A 127.0.0.1
ns IN A IP
host1 IN A IP
host2 IN A IP
hostn1 IN A IP
hostn2 IN A IP
2
  • 1
    You are missing the interface, in my case is eth0: ifconfig eth0 192.168.0.1 netmask 255.255.255.0 up
    – andreatsh
    Nov 22 '16 at 14:57
  • Only one question/topic per post, please! Nov 23 '16 at 10:42
0

Hello fellow Linux fella ! In debian setting network subinterfaces goes like that:

ifconfig eth0:0 IP netmask 255.255.255.0

You should also edit etc/network/interfaces

//do not remove anything!! auto eth0:0 iface eth0:0 inet static address IP netmask 255.255.255.0 auto eth0:1 iface eth0:1 inet static address IP netmask 255.255.255.0

then restart

ifconfig eth0:0 down ifconfig /etc/init.d/networking restart ifconfig

after that you can

ping IP

to check if everything everything is allright

2
  • You should probably note somewhere in your answer that it's ubuntu (or possibly debian) centric. Other distros vary in the path and names of interface config files.
    – Dani_l
    Nov 22 '16 at 15:21
  • sure, I forgot about that Nov 22 '16 at 15:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.