LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 05-26-2015, 09:49 PM   #1
d.custer91
LQ Newbie
 
Registered: May 2015
Posts: 1

Rep: Reputation: Disabled
brctl doesn't seem to be fully communicating internally from network namespace


For some reason "ping -I br1 10.0.0.2" works but "ip netns exec vpn ping -I veth1 10.0.0.2" doesn't. This server is set up as a router. Also "ip netns exec vpn ping -I veth1 google.com" works. "ip netns exec vpn ping -b -I veth1 10.0.0.255" doesn't even work, but "ping -b -I br1 10.0.0.255" does. What am I doing wrong?

ifconfig

Code:
  br0       Link encap:Ethernet  HWaddr 00:1e:67:ad:9e:1d  
              inet addr:79.35.187.235  Bcast:255.255.255.255  Mask:255.255.254.0
              inet6 addr: fe80::21e:67ff:fead:9e1d/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:2311516 errors:0 dropped:0 overruns:0 frame:0
              TX packets:120248768 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0 
              RX bytes:3201074916 (3.2 GB)  TX bytes:7619823231 (7.6 GB)
    
    br1       Link encap:Ethernet  HWaddr 00:1e:67:ad:9e:1e  
              inet addr:10.0.0.1  Bcast:10.0.0.255  Mask:255.255.255.0
              inet6 addr: fe80::21e:67ff:fead:9e1e/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:1250273 errors:0 dropped:0 overruns:0 frame:0
              TX packets:133642410 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0 
              RX bytes:3831971332 (3.8 GB)  TX bytes:17590909099 (17.5 GB)
    
    em1       Link encap:Ethernet  HWaddr 00:1e:67:ad:9e:1d  
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:2795324 errors:0 dropped:0 overruns:0 frame:0
              TX packets:119889487 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000 
              RX bytes:3265375971 (3.2 GB)  TX bytes:7597181742 (7.5 GB)
              Memory:b1200000-b1280000 
    
    em2       Link encap:Ethernet  HWaddr 00:1e:67:ad:9e:1e  
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:3558381 errors:0 dropped:0 overruns:0 frame:0
              TX packets:137716266 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000 
              RX bytes:3977055494 (3.9 GB)  TX bytes:17816302044 (17.8 GB)
              Memory:b1100000-b1180000 
    
    lo        Link encap:Local Loopback  
              inet addr:127.0.0.1  Mask:255.0.0.0
              inet6 addr: ::1/128 Scope:Host
              UP LOOPBACK RUNNING  MTU:65536  Metric:1
              RX packets:197154428 errors:0 dropped:0 overruns:0 frame:0
              TX packets:197154428 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0 
              RX bytes:21894027109 (21.8 GB)  TX bytes:21894027109 (21.8 GB)
    
    veth0     Link encap:Ethernet  HWaddr 12:1e:d6:dd:58:d5  
              inet6 addr: fe80::101e:d6ff:fedd:58d5/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:42 errors:0 dropped:0 overruns:0 frame:0
              TX packets:131111502 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000 
              RX bytes:3644 (3.6 KB)  TX bytes:8260571728 (8.2 GB)
brctl show br0

Code:
bridge name	bridge id		STP enabled	interfaces
    br0		8000.001e67ad9e1d	no	                em1
brctl show br1

Code:
bridge name	bridge id		STP enabled	interfaces
    br1               8000.001e67ad9e1e	no		em2
                                                        veth0
ip netns exec vpn ifconfig

Code:
 lo        Link encap:Local Loopback  
              inet addr:127.0.0.1  Mask:255.0.0.0
              inet6 addr: ::1/128 Scope:Host
              UP LOOPBACK RUNNING  MTU:65536  Metric:1
              RX packets:0 errors:0 dropped:0 overruns:0 frame:0
              TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0 
              RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
    
    veth1     Link encap:Ethernet  HWaddr 42:4c:ad:25:34:b4  
              inet addr:10.0.0.254  Bcast:10.0.0.255  Mask:255.255.255.0
              inet6 addr: fe80::404c:adff:fe25:34b4/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:131111583 errors:0 dropped:0 overruns:0 frame:0
              TX packets:42 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000 
              RX bytes:8260577350 (8.2 GB)  TX bytes:3644 (3.6 KB)
Here is the routing script

Code:
echo -e "\n\nLoading simple rc.firewall-iptables version $FWVER..\n"
    DEPMOD=/sbin/depmod
    MODPROBE=/sbin/modprobe
    
    EXTIF="br0"
    INTIF="br1"
    #INTIF2="eth0"
    echo "   External Interface:  $EXTIF"
    echo "   Internal Interface:  $INTIF"
    
    #======================================================================
    #== No editing beyond this line is required for initial MASQ testing == 
    echo -en "   loading modules: "
    echo "  - Verifying that all kernel modules are ok"
    $DEPMOD -a
    echo "----------------------------------------------------------------------"
    echo -en "ip_tables, "
    $MODPROBE ip_tables
    echo -en "nf_conntrack, " 
    $MODPROBE nf_conntrack
    echo -en "nf_conntrack_ftp, " 
    $MODPROBE nf_conntrack_ftp
    echo -en "nf_conntrack_irc, " 
    $MODPROBE nf_conntrack_irc
    echo -en "iptable_nat, "
    $MODPROBE iptable_nat
    echo -en "nf_nat_ftp, "
    $MODPROBE nf_nat_ftp
    echo "----------------------------------------------------------------------"
    echo -e "   Done loading modules.\n"
    echo "   Enabling forwarding.."
    echo "1" > /proc/sys/net/ipv4/ip_forward
    echo "   Enabling DynamicAddr.."
    echo "1" > /proc/sys/net/ipv4/ip_dynaddr 
    echo "   Clearing any existing rules and setting default policy.."
    
    iptables-restore <<-EOF
    *nat
    -A POSTROUTING -o "$EXTIF" -j MASQUERADE
    COMMIT
    *filter
    :INPUT ACCEPT [0:0]
    :FORWARD DROP [0:0]
    :OUTPUT ACCEPT [0:0]
    -A FORWARD -i "$EXTIF" -o "$INTIF" -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT 
    -A FORWARD -i "$INTIF" -o "$EXTIF" -j ACCEPT
    -A FORWARD -j LOG
    COMMIT
    EOF
    
    echo -e "\nrc.firewall-iptables v$FWVER done.\n"
 
Old 05-27-2015, 02:11 PM   #2
lazydog
Senior Member
 
Registered: Dec 2003
Location: The Key Stone State
Distribution: CentOS Sabayon and now Gentoo
Posts: 1,249
Blog Entries: 3

Rep: Reputation: 194Reputation: 194
What is the output of the following command

Code:
ip netns list
Maybe this might help as you haven't touched on how you configure your name space

Introducing Linux Network Namespaces/

Last edited by lazydog; 05-27-2015 at 02:13 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Network namespace a.cohen Linux - Networking 0 03-12-2014 04:44 PM
hi,how to make two wireless ssid network with linux tools(eg brctl, vconfig or so on) inter_recoba Linux - Wireless Networking 0 11-07-2013 06:44 PM
Network adapter(Realtek RTL8111/8168B) not communicating with network Brett Delport Linux - Networking 1 11-19-2008 08:29 AM
friend class doesn't work when I put in namespace? Winter Knight Programming 10 12-13-2007 12:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 12:43 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration