View Single Post
  #2   (View Single Post)  
Old 19th December 2008
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 4,131
Default

If you ISP gives you a netblock, they are usually fixed.
You can just assign the first IP as normal to the NIC, the remaining IPs you assign as alias with a 255.255.255.255 netmask.
Code:
# ifconfig re0 11.1.1.1 netmask 255.255.255.248
# ifconfig re0
re0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        lladdr 00:19:db:47:b0:4c
        media: Ethernet autoselect (none)
        status: no carrier
        inet6 fe80::219:dbff:fe47:b04c%re0 prefixlen 64 scopeid 0x2
        inet 11.1.1.1 netmask 0xfffffff8 broadcast 11.1.1.7
# ifconfig re0 alias 11.1.1.2 netmask 255.255.255.255
# ifconfig re0 alias 11.1.1.3 netmask 255.255.255.255 
# ifconfig re0 alias 11.1.1.4 netmask 255.255.255.255 
# ifconfig re0 alias 11.1.1.5 netmask 255.255.255.255 
# ifconfig re0 alias 11.1.1.6 netmask 255.255.255.255 
# ifconfig re0
re0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        lladdr 00:19:db:47:b0:4c
        media: Ethernet autoselect (none)
        status: no carrier
        inet6 fe80::219:dbff:fe47:b04c%re0 prefixlen 64 scopeid 0x2
        inet 11.1.1.1 netmask 0xfffffff8 broadcast 11.1.1.7
        inet 11.1.1.2 netmask 0xffffffff broadcast 11.1.1.2
        inet 11.1.1.3 netmask 0xffffffff broadcast 11.1.1.3
        inet 11.1.1.4 netmask 0xffffffff broadcast 11.1.1.4
        inet 11.1.1.5 netmask 0xffffffff broadcast 11.1.1.5
        inet 11.1.1.6 netmask 0xffffffff broadcast 11.1.1.6
See rc.conf(5) how to do this in /etc/rc.conf.
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote