Skip to contentSkip to conversation

No internet connection

DISCUSSION Jason Opperisano 3 participants 4 messages Sep 9, 2004 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 3 lines · Giancarlo Boaron

Ok. I made my iptables script and I forgot to handle the DHCP protocol. So, my firewall box gets its IP address via DHCP. Thats a nice thing to test.

for the sake of the list archives:

  # DHCP server -> client
  iptables -A INPUT -p udp --sport 67 --dport 68 -j ACCEPT

  # DHCP client -> server
  iptables -A OUTPUT -p udp --sport 68 --dport 67 -j ACCEPT

-j

Signature · 1 line
Jason Opperisano <[email protected]>
#2 lore raw
Quoted 5 lines · Jason Opperisano
Quoted 3 lines · Giancarlo Boaron

Ok. I made my iptables script and I forgot to handle the DHCP protocol. So, my firewall box gets its IP address via DHCP. Thats a nice thing to test.

Quoted 7 lines

for the sake of the list archives:

  # DHCP server -> client
  iptables -A INPUT -p udp --sport 67 --dport 68 -j ACCEPT

  # DHCP client -> server
  iptables -A OUTPUT -p udp --sport 68 --dport 67 -j ACCEPT

Not wishing to be paranoid, buuuuuuuuutttttttt..... couldn't you usefully restrict those by source and destination IP?

Signature · 1 line
mors omnia vincit
#3 lore raw
Quoted 10 lines · Nick Drage
Quoted 7 lines

for the sake of the list archives:

  # DHCP server -> client
  iptables -A INPUT -p udp --sport 67 --dport 68 -j ACCEPT

  # DHCP client -> server
  iptables -A OUTPUT -p udp --sport 68 --dport 67 -j ACCEPT

Not wishing to be paranoid, buuuuuuuuutttttttt..... couldn't you usefully restrict those by source and destination IP?

i dunno. assuming you know the IP address of the DHCP server in advance...it could be this:

   iptables -A OUTPUT -p udp -s 0.0.0.0/32 --sport 68 \
     -d 255.255.255.255/32 --dport 67 -j ACCEPT

   iptables -A OUTPUT -p udp --sport 68 \
     -d $DHCP_SRV --dport 67 -j ACCEPT

   iptables -A INPUT -p udp -s $DHCP_SRV --sport 67 \
     --dport 68 -j ACCEPT

with some scripting, you could programatically add in the IP of the FW to those rules and re-run the iptables script every time the address changes...

i guess i was trying to show the building blocks of what it takes to allow a firewall to be a DHCP client...paranoia is left as an exercise for the reader... ;-)

-j

Signature · 1 line
Jason Opperisano <[email protected]>
#4 lore raw
In reply to Nick Drage
Quoted 2 lines · Nick Drage

Not wishing to be paranoid, buuuuuuuuutttttttt..... couldn't you usefully restrict those by source and destination IP?

Probably, but... You usually don't know IP address of DHCP server in advance (ISP can chage it without prior notice, which will happen each time they deem it is time to reorganize their network). You don't know what will be your address before it is assigned to you.

Theoretically, you could modify dhcpclient so that it opens up firewall to be more permissive for those two ports when initially getting IP address, and than making it more strict when both local and DHCP server's addresses are known (and making it more permissive again if DHCP server goes south, so that new one could be discovered).

Theretically, your ISP (I guess it's cable, if using DHCP) should have been protecting you anyhow. Otherwise, any wise ass with Windblows or Linux box could screw up entire cable segment. It would be the last thing he would do (since it would be trivial to pinpoint him). But it might be considered as fun last thing by the before mentioned wise ass.

On the other hand, you should also assume ISP is brain dead and have everything misconfigured (or in better case, not configured at all ;-)

Signature · 3 lines
Aleksandar Milivojevic <[email protected]>    Pollard Banknote Limited
Systems Administrator                           1499 Buffalo Place
Tel: (204) 474-2323 ext 276                     Winnipeg, MB  R3T 1L7