Illegal immigrant sentenced to 18 months in prison on gun charges