MAC ADRRESS 설정방법

toatoa의 이미지

안녕하세요
현재 타켓에서 다음과 같이 MAC ADDRESS를 설정하였습니다.
ifconfig eth0 down
ifconfig eth0 hw ether 00:40:5a:00:12:45
ifconfig eth0 up

헌데 ifconfig로 보면
Link encap:Ethernet HWaddr 00:00:C0:FF:EE:09과 같이 나옵니다.

왜 설정값 00:40:5a:00:12:45이 적용되지 않는지 모르겠습니다.

고수님들의 답변부탁드립니다.
수고하세요
감사합니다.

ddanggi의 이미지


가끔 디바이스드라이버가
HW 주소를 바꾸어주는 기능을 지원 안 해주는 경우가 있습니다..--;;

해당 디바이스드라이버가 지원하는지부터 확인이 필요할 것으로 보입니다.

이상 허접 답변이었습니다..--;;

toatoa의 이미지

답변감사합니다.
이더넷 콘트롤로는 cs8900을 쓰고 있습니다.
이건 지원해주는 걸로 알고있는데..

감사합니다.

agkrwyasym의 이미지


try...

ifconfig eth0 down hw ether 00:40:5a:00:12:45
ifconfig eth0 up

toatoa의 이미지


결과는 변화질 않습니다.

답변에 감사드립니다.

toatoa의 이미지

1. u-boot에서는
CONFIG_OVERWRITE_ETHADDR_ONCE

를 지정해 주면 ethernet address가 한번 overwrite가 됩니다. 당연히 ethernet은 쓴다고 되어 있어야 하고요.

2. kernel의 driver에서는 이렇게 처리해주면 됩니다.

static unsigned char my_ethaddr[MAX_ADDR_LEN];
/* need to get the ether addr from armboot */
static int __init ethaddr_setup(char *line)
{
char *ep;
int i;

printk("ethaddr_setup()\n");
memset(my_ethaddr, 0, MAX_ADDR_LEN);
/* there should really be routines to do this stuff */
for (i = 0; i < 6; i++)
{
my_ethaddr[i] = line ? simple_strtoul(line, &ep, 16) : 0;
if (line)
line = (*ep) ? ep+1 : ep;
printk("mac[%d] = 0x%02X\n", i, my_ethaddr[i]);

}
return 0;
}
__setup("ethaddr=", ethaddr_setup);

이 부분을 커널의 cs89x0.c에 삽입해 주신 후,

부트로더에서 넘겨주는 kernel command line argument를 이렇게 지정해 주면 됩니다.
setenv bootargs root=/dev/nfs rw nfsroot=172.16.1.253:/korea-dokdo/nfsmount/rootfs-aesop ip=172.16.1.100:172.16.1.253:172.16.1.1:255.255.255.0::eth0:off console=ttyS0 ethaddr=08:00:3e:26:0a:5b

여기의 맨 뒤에 있는 ethaddr=08:00:3e:26:0a:5b
이 cs8900에서 자동 해석하게 코드를 작성하면 됩니당....^^

academic의 이미지

Mac address를 직접 지정하는게 가능한 건가요?

당연히 불가능할 것이라고 생각했던 건데...

--
academic은 제 고등학교 때 동아리 이름입니다.
academic, 아주 가끔은 저도 이랬으면 좋겠습니다.

----
academic은 제 고등학교 때 동아리 이름입니다.
academic, 아주 가끔은 저도 이랬으면 좋겠습니다.

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.