---
title: "request.getRemoteAddr = 0:0:0:0:0:0:0:1"
author: "harbey"
date: "2010-05-24T14:35:42Z"
tags: []
categories: ["企业架构"]
slug: "request-getremoteaddr-0-0-0-0-0-0-0-1"
draft: false
lastmod: "2010-05-24T14:35:42Z"
id: 673874
url: "https://harbey.iteye.com/blog/673874"
---

做IP地址过滤时，非代理获取客户端ip时，用http://localhost:8080/aapname访问应用程序，通过如下代码获取客户端ip为0:0:0:0:0:0:0:1：

```java
ServletActionContext.getRequest().getRemoteAddr();  

```

原因是跟操作系统有关系，我用的是windows7操作系统，支持IP V6格式，所以输出0:0:0:0:0:0:0:1；