A method of operating a switch or an access node in a network, the switch or access node having a plurality of interfaces through which data packets can be received and forwarded, the network further comprising one or more gateway nodes (6;16) and one or more user terminals (4;14), each of the gateway nodes and the user terminals having a respective address, the method in the switch or access node comprising: identifying the address for at least one of the gateway nodes; comparing a source address specified in a data packet received from a user terminal at one of the interfaces of the switch or access node to the identified addresses for the one or more gateway nodes; storing the source address specified in the data packet and the identity of the interface through which the data packet was received if the source address specified in the data packet does not match an address for any of the one or more gateway nodes; and discarding the data packet if the source address specified in the data packet matches an address for any of the one or more gateway nodes, wherein the step of identifying the address for at least one of the gateway nodes comprises: analysing data packets received at the switch or access node to identify those data packets that have been transmitted by a gateway node, and; characterised in that the step of analysing data packets received at the switch or access node comprises: inspecting the received data packets for IPv6 messages by: analyzing a Neighbour Advertisement, NA, message to check if a router flag is set, and if the router flag is set, identifying a source address specified in the NA message as an address for a said gateway node, and/or, analyzing Internet Control Message Protocol, ICMPv6, messages to check if a target link-layer address is present, and if not present, analyzing a NA message sent as a reply to a Neighbour Solicitation, NS, message to check if a router flag is set, and if the router flag is set, identifying a source address specified in the NA message as an address for a said gateway node. identifying the address for at least one of the gateway nodes; comparing a source address specified in a data packet received from a user terminal at one of the interfaces of the switch or access node to the identified addresses for the one or more gateway nodes; storing the source address specified in the data packet and the identity of the interface through which the data packet was received if the source address specified in the data packet does not match an address for any of the one or more gateway nodes; and discarding the data packet if the source address specified in the data packet matches an address for any of the one or more gateway nodes, wherein the step of identifying the address for at least one of the gateway nodes comprises: analysing data packets received at the switch or access node to identify those data packets that have been transmitted by a gateway node, and; characterised in that the step of analysing data packets received at the switch or access node comprises: inspecting the received data packets for IPv6 messages by: analyzing a Neighbour Advertisement, NA, message to check if a router flag is set, and if the router flag is set, identifying a source address specified in the NA message as an address for a said gateway node, and/or, analyzing Internet Control Message Protocol, ICMPv6, messages to check if a target link-layer address is present, and if not present, analyzing a NA message sent as a reply to a Neighbour Solicitation, NS, message to check if a router flag is set, and if the router flag is set, identifying a source address specified in the NA message as an address for a said gateway node. analysing data packets received at the switch or access node to identify those data packets that have been transmitted by a gateway node, and; characterised in that the step of analysing data packets received at the switch or access node comprises: inspecting the received data packets for IPv6 messages by: analyzing a Neighbour Advertisement, NA, message to check if a router flag is set, and if the router flag is set, identifying a source address specified in the NA message as an address for a said gateway node, and/or, analyzing Internet Control Message Protocol, ICMPv6, messages to check if a target link-layer address is present, and if not present, analyzing a NA message sent as a reply to a Neighbour Solicitation, NS, message to check if a router flag is set, and if the router flag is set, identifying a source address specified in the NA message as an address for a said gateway node. analyzing a Neighbour Advertisement, NA, message to check if a router flag is set, and if the router flag is set, identifying a source address specified in the NA message as an address for a said gateway node, and/or, analyzing Internet Control Message Protocol, ICMPv6, messages to check if a target link-layer address is present, and if not present, analyzing a NA message sent as a reply to a Neighbour Solicitation, NS, message to check if a router flag is set, and if the router flag is set, identifying a source address specified in the NA message as an address for a said gateway node.