# ifconfig: SIOCIFCREATE2: Invalid argument



## brianjm (Aug 1, 2020)

I am trying to create a network alias for a jail I want to install NextCloud in, but when I run `ifconfig nxt0 create`, I get the following error:

`ifconfig: SIOCIFCREATE2: Invalid argument`

I read on this forum post that there may be something wrong with my kernel modules but unfortunately there was no real solution offered.

My server recently suffered multiple repeated power losses when my house lost power due to a storm (the power would come back on for a few seconds before getting cut off, taking the server with it), so there is a very good chance that there is some sort of corruption or out of sync issues going on but I am not sure how to fix the problem.

I am running FreeBSD 12.1-RELEASE.


----------



## George (Aug 1, 2020)

Do you really have an interface called "interface"?
ifconfig():

```
interface
             This parameter is a string of the form "name unit", for example,
             "ed0".
```


----------



## brianjm (Aug 1, 2020)

Elazar said:


> Do you really have an interface called "interface"?
> ifconfig():
> 
> ```
> ...



No, I am trying to create a new interface called 'nxt0' but when I try to do that I get the error. The command I am using is `ifconfig nxt0 create`. I also updated my original post to correct the mistake in commands I made.


----------



## Phishfry (Aug 1, 2020)

First make sure you have the correct name for the interface by querying:
`pciconf -lv| grep -B3 -i network`
Then check to make sure it exists:
`ifconfig`
If it exists there you will need to configure it for either DHCP or a Static IP address.








						Chapter 13. Configuration and Tuning
					

This chapter explains much of the FreeBSD configuration process, including some of the parameters which can be set to tune a FreeBSD system.




					www.freebsd.org


----------



## George (Aug 1, 2020)

It might be bnxt(4).


----------



## brianjm (Aug 1, 2020)

Phishfry said:


> First make sure you have the correct name for the interface by querying:
> `pciconf -lv| grep -B3 -i network`
> Then check to make sure it exists:
> `ifconfig`
> ...




This is a network alias for a jail. My actual physical network device is perfectly functional and I am able to connect to a network and the Internet. I am getting the error when I try to create a new alias for my jail to use.


----------



## brianjm (Aug 1, 2020)

Elazar said:


> It might be bnxt(4).



I don't have a Broadcom adapter.


----------



## Mjölnir (Aug 1, 2020)

`apropos nxt` ... `man`bnxt(4) is this what you mean? Obsoleted by previous post


----------



## brianjm (Aug 1, 2020)

mjollnir said:


> `apropos nxt` ... `man`bnxt(4) is this what you mean? Obsoleted by previous post




```
root@server:/home/brian # apropos nxt
CMSG_DATA, CMSG_FIRSTHDR, CMSG_LEN, CMSG_SPACE, CMSG_NEXTHDR, CMSG_NXTHDR(3) - socket control message routines for ancillary data access
sysdecode_mask, sysdecode_atflags, sysdecode_fcntl_fileflags, sysdecode_fileflags, sysdecode_filemode, sysdecode_flock_operation, sysdecode_mlockall_flags, sysdecode_mmap_flags, sysdecode_mmap_prot, sysdecode_mount_flags, sysdecode_msg_flags, sysdecode_msync_flags, sysdecode_open_flags, sysdecode_pipe2_flags, sysdecode_reboot_howto, sysdecode_rfork_flags, sysdecode_sctp_nxt_flags, sysdecode_sctp_rcv_flags, sysdecode_sctp_snd_flags, sysdecode_semget_flags, sysdecode_sendfile_flags, sysdecode_shmat_flags, sysdecode_socket_type, sysdecode_thr_create_flags, sysdecode_umtx_cvwait_flags, sysdecode_umtx_rwlock_flags, sysdecode_vmprot, sysdecode_wait4_options, sysdecode_wait6_options, sysdecode_accessmode, sysdecode_capfcntlrights(3) - print name of various bitmask values
bnxt, if_bnxt(4) - Broadcom NetXtreme-C/NetXtreme-E Family Ethernet driver
```


----------



## Phishfry (Aug 2, 2020)

brianjm said:


> This is a network alias for a jail. My actual physical network device is perfectly functional and I am able to connect to a network and the Internet. I am getting the error when I try to create a new alias for my jail to use.


Alias would need to be created in /etc/rc.conf or from the command prompt like this:
`ifconfig nxt0 192.168.1.5 netmask 255.255.255.255 alias`








						FreeBSD IP Alias: Setup 2 or More IP address on One NIC - nixCraft
					

IP aliasing is the process of assigning more than one IP address to a network interface. This is useful for Apache web server virtual hosting or other network servers such as ftp server. This tutorial explains how to assign one or more IP address to a single network interface under FreeBSD...




					www.cyberciti.biz
				




Have you had a look at this page. It is really informative about VNET jails..








						Arranging Your Virtual Network on FreeBSD
					

...blogging bits of BSD



					blog.grem.de


----------



## Mjölnir (Aug 3, 2020)

Phishfry, where do you have all this knowledge you are presenting to us?  Do you put every link you're stumbling across into a knowledge database?  Or do you look it up in a search engine?


----------



## Phishfry (Aug 3, 2020)

I do like to read. My sources are here on the forum, the mailing lists and reddit. SirDice has been a valuable asset.

So OP as you can see. There is no nxt interface on FreeBSD.
If you don't believe me check the source at /usr/src/sys/dev. There is no nxt directory.
So maybe share with us what the interface you actually have and then we can help you better.
You probably don't have corrupt files as I get the same response as you.

```
rootbeer@E6420:~ # ifconfig nxt0 create
ifconfig: SIOCIFCREATE2: Invalid argument
```


----------



## MrRooster (Nov 15, 2020)

brianjm said:


> This is a network alias for a jail. My actual physical network device is perfectly functional and I am able to connect to a network and the Internet. I am getting the error when I try to create a new alias for my jail to use.


I think you have made the same mistake I have. The name for the new interface isn't arbitary as I also assumed.

You can only create interfaces that are supported by FreeBSD.

In this case you need to create a epair interface (see the epair man page for more info), but briefly...

`ifconfig epair0 create`

this will create epair0a locally, you then have epair0b used in the jail. These act like two ends of an ethernet cable.

So in the jail you would do something like:


```
ifconfig epair0b 192.168.1.2 netmask 255.255.255.0
```

then add the epair0a interface to the bridge on the host.

You can use something like this in the host section of jail.conf:


```
vnet;
        vnet.interface="epair0b";
        exec.prestart="ifconfig epair0 create up";
        exec.prestart+="ifconfig bridge0 addm epair0a";
        exec.poststop="ifconfig bridge0 deletem epair0a";
        exec.poststop+="ifconfig epair0a destroy";
```


----------

