# tftpd and interface alias issue



## rich9000 (Feb 12, 2013)

I am running FreeBSD 8.1.

inetd is running tftpd and I am able to upload and download files without issue.

```
tftp    dgram   udp     wait    root    /usr/libexec/tftpd      tftpd -d -l -s /tftpboot
```
When I add an alias to the interface:

```
ifconfig_igb0="inet xx.xx.xxx.12  netmask 255.255.255.0"
ifconfig_igb0_alias0="inet xx.xx.xxx.22 netmask 255.255.255.255"
```
tftp works fine on the primary address but on the secondary I get no response.

Apache works on both of the IP addresses. I have turned off pf to test to see if it*'*s the problem. I know that tftpd is getting the request for the file, xferlog:

```
Feb 12 00:59:50 admin tftpd[31596]: Filename: 'test.txt'
Feb 12 00:59:50 admin tftpd[31596]: Mode: 'netascii'

Feb 12 01:00:32 admin tftpd[31716]: Filename: 'test.txt'
Feb 12 01:00:32 admin tftpd[31716]: Mode: 'netascii'
```
The first one is to the primary IP, the second one at 1:00:32 is to the alias. 

As well as from tcpdump:

Bad request to the alias:

```
01:10:13.971249 IP corporate.xxxxxxxx.net.56476 > server2.xxxxxxx.com.tftp:  51 RRQ "test.txt" netascii blksize 512 timeout 10 tsize 0
01:10:13.973752 IP admin.xxxxxxxxxx.com.31378 > corporate.xxxxxxxxx.net.56476: UDP, length 34
```

My PC is corporate. Server2 is the alias IP. It goes into server2 but the response comes out from admin which is the primary IP address. Could this be part of the problem?  

Good request to the primary:

```
01:10:25.510879 IP corporate.xxxxxxxx.net.56477 > admin.xxxxxxxxx.com.tftp:  51 RRQ "test.txt" netascii blksize 512 timeout 10 tsize 0
01:10:25.513425 IP admin.xxxxxxxxxx.com.43252 > corporate.xxxxxxxxxx.net.56477: UDP, length 34
01:10:25.605373 IP corporate.xxxxxxxxx.net.56477 > admin.xxxxxxxxxxxxx.com.43252: UDP, length 4
01:10:25.605440 IP admin.xxxxxxxx.com.43252 > corporate.xxxxxxxxxx.net.56477: UDP, length 21
01:10:25.690681 IP corporate.xxxxxxx.net.56477 > admin.xxxxxxxxx.com.43252: UDP, length 4
```

Anyone know what is going on? How can I troubleshoot this further. Can I bind tftp to the alias IP address and would that fix it? 

Thanks for looking at this.

rich


----------



## SirDice (Feb 12, 2013)

rich9000 said:
			
		

> I am running FreeBSD 8.1


Update to 8.3, 8.1 has been end-of-life since July 2012.


----------



## J65nko (Feb 12, 2013)

rich9000 said:
			
		

> Can I bind tftp to the alias IP address and would that fix it?



You can check whether tftp is bound to the wildcard address or to a specific one with netstat(1):


```
[cmd=#]netstat -an -f inet[/cmd]
Active Internet connections (including servers)
Proto Recv-Q Send-Q  Local Address          Foreign Address        (state)
tcp4       0     48  xxx.xxx.xxx.xx.22      yy.yyy.yyy.yyy.53293   ESTABLISHED
[color=blue]tcp4       0      0  xxx.xxx.xxx.xx.80      *.*                    LISTEN[/color]
tcp4       0      0  127.0.0.1.25           *.*                    LISTEN
[color=blue]tcp4       0      0  *.22                   *.*                    LISTEN[/color]
```
Here the webserver is bound to a specific address, while the sshd daemon using port 22 is listening on all addresses.


----------

